AbdulBazith

AbdulBazith

Tamil Nadu, Tirunelveli

Member Since 6 Months Ago

Experience Points 9,340
Experience
Level
Lessons Completed 0
Lessons
Completed
Best Reply Awards 1
Best Answer
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.

14 Dec
21 hours ago

AbdulBazith left a reply on How To Autheticate User Weather Employer Or Job Seeker And Make Login Them

@snapey thank you for you response.

Actually what you said is right.

Better i can redirect them as per their roles.

But then why should i have two login forms. I can use one login form itself na?

AbdulBazith left a reply on How To Autheticate User Weather Employer Or Job Seeker And Make Login Them

@gurur thanks for your responses guys..

but for why i need to move to gaurds.?

and @siangboon thank you for you response and suggesting the lesson..

13 Dec
1 day ago

AbdulBazith started a new conversation How To Autheticate User Weather Employer Or Job Seeker And Make Login Them

Guys iam working with a project job portal site.

Iam using manual method of authentication to authenticate the user.

i had a column type in my user table when a job seeker comes and register his his email id and password is stored in user table with type column as "Job seeker"

and when a employer comes and register his info also stored in user table with type column as "Employer".

Now i need to login them based on their type.

i used manual process.

  if (auth()->attempt(request(['email', 'password'])) == true )
        {           

            return redirect()->route('Employer-registration.index');
        }

 else{
         
        return back()->withErrors([
            'message' => 'The email or password is incorrect, please try again'
        ]);


the above code works fine, but just checks only the user name and password.

i have different contollers and 2 different froms for employer login and seeker login.

now whats my problem is

in my employer login form if i try give seeker's user name and password it allowed to login. but it shold not do like that.

so that i wrote a query

  if (auth()->attempt(request(['email', 'password'])) == true  &&  Auth::user()->user_type == "Employer")
        {
          
            return redirect()->route('Employer-registration.index');
        }

 else{
        
        return back()->withErrors([
            'message' => 'The email or password is incorrect, please try again'
        ]);

if user name and password match then check the type then login.

but here what hapening is when i try to enter user name and pasword of a seeker in employer login form it comes checks the user name and password and check the type so condition falis and the else protion error message is displayed but the seeker is logged in. i kept nav bar name as person who is logged in. the the nav bar changes to display the seeker name. as he is logged in.

my problem is need to check condition and based on employer or seeker it must be logged in and to display their respective profile.

through my employer login form only employer shud login, if a seeker gives his user name and password the it should not allow him to login, only it should show error.

but my query it showing error but allowing the seeker to login.

some one help please.

12 Dec
2 days ago

AbdulBazith started a new conversation Error In SQLSTATE[22007]: Invalid Datetime Format: 1366 Incorrect Integer Value: '' For Column 'landline' At Row 1 (SQL:

Guys iam working with project.

this is my company registration migration


 Schema::create('company_registration', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('employer_id')->unsigned();
            $table->foreign('employer_id')->references('id')->on('users');
            $table->string('name');
            $table->string('type');
            $table->string('industry');
            $table->longText('description');
            $table->string('city');
            $table->string('district');
            $table->string('state');
            $table->string('country');
            $table->bigInteger('pin');
            $table->bigInteger('mobile');
            $table->bigInteger('landline');
            $table->string('email_id')->unique();
            $table->string('website');
            $table->string('logo');
            $table->timestamps();
        });


and in phpmyadmin i set the values can be null.

and in my controller iam not validating..

directing i tried to insert the data but showing error.i didnt fill the data from the form. just i left the textboxex emplty. but why this is showing like this error.

SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: '' for column 'landline' at row 1 (SQL: insert into `company_registration` (`employer_id`, `name`, `type`, `industry`, `description`, `city`, `district`, `state`, `country`, `pin`, `mobile`, `landline`, `email_id`, `website`, `updated_at`, `created_at`) values (29, , Company, , , , Ariyalur, Tamil Nadu, India, 6666, 666, , [email protected], , 2018-12-12 07:13:57, 2018-12-12 07:13:57))

this is my controller

 $company_registration=new CompanyRegistration;

            $company_registration->employer_id =auth()->id();
            $company_registration->name = trim($request->name);
            $company_registration->type = trim($request->type);
            $company_registration->industry = trim($request->industry);
            $company_registration->description = trim($request->description);
            $company_registration->city = trim($request->city);
            $company_registration->district = trim($request->district);
            $company_registration->state = trim($request->state);
            $company_registration->country = trim($request->country);
            $company_registration->pin = trim($request->pin);
            $company_registration->mobile = trim($request->mobile);
            $company_registration->landline = trim($request->landline);
            $company_registration->email_id = trim($request->email_id);
            $company_registration->website = trim($request->website);          

            $company_registration->save();

            dd( $company_registration);

i think leaving the text boxex empty this showing error. but i didnt validated and in my table those fields can be null. then why its showing error

Some one help please

10 Dec
4 days ago

AbdulBazith left a reply on How To Display Name In Nav Bar From Db

@kvithalani thank you for your response..

@globals thank you for your response.

It worked.

What i did is, changed the relationship to hasone


public function personal()
    {
        return $this->hasOne('App\PersonalDetails', 'seeker_id');
    }

and used

{{ auth()->user()->personal->first_name }}

it workked

thank you guys..

AbdulBazith left a reply on How To Display Name In Nav Bar From Db

@andreich1980 thank you for your response.

but if i give {{ auth()->user()->personal_details->first_name }} it showing error

Trying to get property 'first_name' of non-object

@snapey thank you for your response

this is my user model relationship

  public function personal()
    {
        return $this->hasMany('App\PersonalDetails', 'seeker_id');
    }

and i gave like this

{{ auth()->user()->personal()->first_name }} but shows error

Undefined property: Illuminate\Database\Eloquent\Relations\HasMany::$first_name 

and also tried {{ auth()->user()->personal->first_name }}

But showing error

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

AbdulBazith started a new conversation How To Display Name In Nav Bar From Db

Guys iam working with a project job portal site.

In my nav bar i need to display the name of the user who is logged in.

at first i displayed the email id of the user whois logged in.

for that i used

  {{ auth()->user()->email }}

the name is stored in personal details table. column(first_name)

how can i display the name instead of the mail id.

PersonalDetails this is my model and personal details this is my table

instead of {{ auth()->user()->email }} what can i use to display the name

kindly some one help

04 Dec
1 week ago

AbdulBazith left a reply on Manual Authentication Process With User Defined Table In Laravel

@snapey thank you for you response..

Ya understood.. Let me change the table and make it as one.

thanks for the suggestion..

Kindly if possible please check my another post

Refer: https://laracasts.com/discuss/channels/laravel/how-to-check-if-values-are-repeated-from-controller-laravel

question: How to check if values are repeated from controller laravel

Please please

AbdulBazith left a reply on How To Perform OTP To My Application In Laravel

@d9705996 thank you thank youu sooo much for your response. and sorry for delay

i understood..

and can you suggest any links for manual otp process pelase?

03 Dec
1 week ago

AbdulBazith left a reply on Manual Authentication Process With User Defined Table In Laravel

@munazzil same error

Method employeruser does not exist.

AbdulBazith left a reply on Manual Authentication Process With User Defined Table In Laravel

@munazzil so that what hapens?

Where iam checking the condition?

if email and password is corect that condition?

AbdulBazith left a reply on Manual Authentication Process With User Defined Table In Laravel

@munazzil

that worked fine. because at present i only kept mobile number as password.

simply to say how i can authenticate manually EmployerUser table

AbdulBazith left a reply on Manual Authentication Process With User Defined Table In Laravel

@snapey @munazzil thank you for your responses.

@munazzil actually thats not my problem. the model and table is the problem here.

the code which u gave is for user model authentication

but what i had used is EmployerUser model for authentication

AbdulBazith left a reply on Manual Authentication Process With User Defined Table In Laravel

@mitchelljulie thank you for your response . Sorry i cant get it what u said

Kindly get u slightly explain

AbdulBazith started a new conversation Manual Authentication Process With User Defined Table In Laravel

Guys iam working with a project job portal site.

for job seeker i done manual authentication with user table

this is my controller for manual authentication process

public function store(Request $request)
    {
        if (auth()->attempt(request(['email', 'password'])) == false) {
            return back()->withErrors([
                'message' => 'The email or password is incorrect, please try again'
            ]);
        }

        return redirect()->route('login_logout.index');     

    }


this works fine. perfectly authenticating and logging the user.

this is my model for that user table

<?php

namespace App;

use Illuminate\Notifications\Notifiable;

use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{

    use Notifiable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'user_type','email',  'mobile_number',  'password','type','first_name','last_name','progress_value','is_accepted',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];

     /**
     * Add a mutator to ensure hashed passwords
     */

    public function setPasswordAttribute($password)
    {
        $this->attributes['password'] = bcrypt($password);
    }
}

Now i need to authenticate employer registration.

i created a model EmployerUser

this is my model

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

use Illuminate\Notifications\Notifiable;

class EmployerUser extends Model
{
    //

    use Notifiable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'user_type','email_id',  'mobile',  'password','is_accepted',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];

     /**
     * Add a mutator to ensure hashed passwords
     */

    public function setPasswordAttribute($password)
    {
        $this->attributes['password'] = bcrypt($password);
    }
}



and i inserted data with the cotroller.

$employer_user =  EmployerUser::create([
                'email_id' => $request->email_id,
                'mobile' => $request->mobile,
                'password' =>$request->mobile,
                'user_type'=>'Employer',
                'is_accepted'=>0,

            ]);


this also worked fine.

but when it comes to authentication. there comes the problem

this is what i did to authenticate employer

public function employer_login(Request $request)
    {
        if (auth()->attempt(request(['email', 'password'])) == false) {
            return back()->withErrors([
                'message' => 'The email or password is incorrect, please try again'
            ]);
        }
        return redirect()->route('Employer-registration.index');

    }

But this is authenticating with user table..

what can i do

i placed employeruser() here if (auth()->employeruser()->attempt(request(['email', 'password'])) == false)

but showing error

Method employeruser does not exist.

how can i authenticate

and after login in my user i used this to fetch all records $user = Auth::user(); this fetched all records.

but if i give $employeruser = Auth::employeruser (); it showing the same error

Method employeruser does not exist.

What should i do??

Kindly some one help please..

01 Dec
1 week ago

AbdulBazith left a reply on Disable Required Input Property Is Not Working And Still Validating.

@lostdreamer_nl thank you thank you soo much for your clear explanation..

you understood what my expectation and what my problem and you gave me clear response and suggestion..

I know its better to write validation of our own, but i know only to display the validated error msg in alert box.

But my boss is expecting the error msg to be somewhat good.

i think you might watched the demo of the package which i took. it looks good. if input field is empty then the box becomes red and a cross mark is displayed.

Can u suggest me any package for my validation process please..

dont think that everything i am asking to you, iam in dead end so only.

and kindly if possible please refer my another post which is related to javascript

refer: https://laracasts.com/discuss/channels/laravel/how-to-check-if-values-are-repeated-from-controller-laravel

Question: How to check if values are repeated from controller laravel

please please

AbdulBazith left a reply on Barryvdh/laravel-dompdf Not Installing In My Project

@palak27 thanks for your response

Surely i will try..

30 Nov
2 weeks ago

AbdulBazith left a reply on How To Perform OTP To My Application In Laravel

@d9705996 thank you for your response.

Your saying that manual process has no security.

My boss dont need google package because the time 30 secs must be changed.

my boss says he need to customize the time of otp

AbdulBazith left a reply on Barryvdh/laravel-dompdf Not Installing In My Project

@vajid thank you for your response.

but i face lots of problem in using dompdf and snappy in my old project.

then i followed barryvdh/laravel-dompdf packages

it looks easy for me thats why i followed that still iam following that.

AbdulBazith left a reply on Disable Required Input Property Is Not Working And Still Validating.

@munazzil @lostdreamer_nl thank you for your responses

@munazzil yes u are right. we can remove that required property from that control. but i need that. i will explain it clearly

@lostdreamer_nl i understood that, but what you saying whether to change that code or not in line number 89..

i couldnt get these lines I think its safe to make this change, actually, the original author of the package should have come accross this problem, but you took a package that was written in 1 go, 10 months ago, no updates, no issues, no nothing..... Normally I'd try to stick to packages that have been more thoroughly tested.

and i have changed that coding still it not working..

this is my control


<div class="row mb-4" style="display: none;" id="np">
                    <div class="col-md-3"><label for="sel1">Notice Period</label></div>
                    <div class="col-md-3">
                        <div class="form-group" id="frm_grp" >
                            <select class="form-control" id="notice_period" name="notice_period" required >
                                <option value="">Select Notice Period</option>
                                <option value="15 days or Less"> 15 days or Less</option>
                                <option value="1 Month"> 1 Month</option>
                                <option value="2 Months">2 Months</option>
                                <option value="3 Months">3 Months</option>
                                <option value="More than 3 Months">More than 3 Months</option>
                            </select>
                        </div>
                    </div>
                </div>



there is a question in my form whether his working company is present or not

if he clicks yes then the notice period control will be visible to him. so he need to select the notice period.

if he clicks no then some other text box which makes to enter him the date will be shown

Refer this image: https://imgur.com/a/YKLlY7y

see the above image i have changed the code as what you said.

and see this image: https://imgur.com/a/PaoCzpR

see the required is disabled, and the control is hidden but still the error msg is there.

Actually initially when form loads it works fine. if the seeker clicks no then that control is hidden and everthing is fine.

But just i tested the application by clicking yes then the control is visible then i left it blank so it is validated and error msg is shown, and then i clicked no so that the cotrol became hidden, but that error msg not vanishing.

Simply to if that control is validated with visible and then that control becomes hidden means , its not working.

that the problem here.

i dont know what i need to doo.

AbdulBazith left a reply on Barryvdh/laravel-dompdf Not Installing In My Project

@palak27 thank you for your response.

It worked.

Now i can use the normal procedure of barryvdh package,? will any syntax problem occur?

can i follow this link for further process

https://github.com/barryvdh/laravel-dompdf

AbdulBazith left a reply on Barryvdh/laravel-dompdf Not Installing In My Project

@knubbe82 thank you for your response

but instead of upgrading the laravel why can i use a least version of barryvdh package..

AbdulBazith started a new conversation How To Perform OTP To My Application In Laravel

Guys iam working with a project job portal site.

I have a doubt in otp. iam new to OTP process.

I have finished my module with authentication etc.

Now what my client expecting is to have a OTP verification and then the seeker must be registered.

Just now i verified about OTP process.

  1. when a seeker come and fill the registration form with his number it moves to controller to store i user table, so at that point a random number must be generated.

  2. that generated number mus be added to the user table along with the id. then that random number is sent to that number with the help of sms gateway.

3)after the sms is sent the user is redirected to a page where he/she will enter the generated number. then the user will enter the OTP number and then he will submit.

  1. after that it moves to controller there the OTP is cross checked and then if it is right the user is accepted and he is allowed to the logged page.

This is the process am i right??

Am i missing something?

whether these steps can be done manually or need to use package to generate random number and to check it.

in net they showed


fleetfoot/otp  


Link for this: https://github.com/Oviyum/laravel-otp

the above mentioned package with all facilities.

Iam in doubt that can OTP done manually? will it be secure?

else using package is better idea? will that be secure??

kindly Every one suggest your ideas please

If possible Kindly share any related links of videos please

AbdulBazith left a reply on My Hidden Input Fields Also Validated In Javascript How To Solve

@realrandyallen i have posted this as a new post because i found almost solution, still facing problem. in that new post i explained everthing with images and coidng. Kindly if possible help me please.

Link: https://laracasts.com/discuss/channels/javascript/disable-required-input-property-is-not-working-and-still-validating

Question: disable required input property is not working and still validating.

And thank you so much for your resposes

AbdulBazith started a new conversation Disable Required Input Property Is Not Working And Still Validating.

Guys this question is repeated. but i found the solution almost but still cant get it. i dont know how to resolve it.

iam working with a project.

iam using native-validations-master downloaded it from net.

this is the link for that: https://www.cssscript.com/custom-html5-form-validator-native-validations/

It also contain demo Kindly refer it.

to perform validation i need to attach the form-validation.js file in my project and then,

in my form

document.getElementById('experience_form').validateForm();

//where experience_form is my form name and validateForm is function name in the validation js file

my problem is i have hidden input fields in this form. those also validated so that i cant submit the form.

if that input fields are visible then only it must be validated. how to do that?

i searched in net and did this


  document.getElementById('experience_form').validateForm(
        {
         ignore: "#hidden"
         }
  );

but not worked. still it is validating

i referred in net but most of the solutions are based on jquery.

Then what i decided is to check in chrome dev tools. i got a solution that even the input field is hidden the required property is enabled. so i decided to disable the property.

this is the image when the required property is enabled and the dropdown down is given corectly. the the below given image. notice period is the field which will be hidden.

Currently in the below image it is not hidden and the required property is also enabled

Refer this image: https://imgur.com/a/3oPp27d

The input field is not hidden so the required property is also enabled. it is validating. and see down i marked the class name is changed to has-success. it is changed to success with the help of form-validation.js file.

Now the notice period field is with error refer the below image.

Refer the image: https://imgur.com/a/6vabvcd

in the above image see that when error is there then the class name changed to has- error and also error message is displayed in tag <span>Please select an option form the list</span>

so what i planned is to disable the required property in the notice period contol.

I have a radio button with yes and no options. when yes is clicked the comtol is enabled and when no is clicked the contol will be disabled.

so when changing the radio button to no i placed the below code.

  document.getElementById("notice_period").required = false;

everything works fine. the required property is disabled. but still the form is not submitting.

At-last i found the solution that the span tag is fault here.

Refer the image: https://imgur.com/a/GoF8Pdj

See here when the no radio button is clicked the notice period control is hidden and also see the dev tool, the required property also disabled. but note that the span tag is still there. thats the fault here. The span tag is present so the form is not submitted.

IF i delete the span tag in the dev tool then if i click the sumbit its working.

i dont know how could i disble the span tag.

The span tag is present only when there is error.

this the form-validation.js file

/*
* Learn about Javascript Basic validation API https://www.w3schools.com/js/js_validation_api.asp
* Learn about Data attributes: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset
*
* You can can custom error messages with these data attributes
* data-require-error        used to display custom message for required field
* data-pattern-error        used to display custom message for field with pattern attribute
*
* Here is a list of configuration variables that can be passed while initializing form validation
* The value for these variables will override default value if passed otherwise default value will be used.
*
* invalidEmail                      :Message that you want to display in case of invalid input
* invalidNumber                     :Message that you want to display in case of invalid input
* invalidPhone                      :Message that you want to display in case of invalid input
* invalidOption                     :Message that you want to display in case of invalid input
* invalidCheckbox                   :Message that you want to display in case of invalid input
* fillOut                           :Message that you want to display in case of invalid input
* invalidRange                      :Message that you want to display in case of invalid input
* invalidLength                     :Message that you want to display in case of invalid input
* invalidGroupOption                :Message that you want to display in case of invalid input
* messageWrapperTag                 : valid HTML element that you want to use to wrap error message
* successClass                      : class name
* errorClass                        : class name
* closestTagSelector                : any valid selector, it can be an id OR class i.e  '#form-group' OR  '.form-group'
*
 */
var EmailMessage = "Please enter a valid email address.";
var NumberMessage = "Please only enter numbers.";
var PhoneMessage = "Please enter a valid phone number.";
var OptionMessage = "Please select an option from the list.";
var CheckboxMessage = "Please check the required box.";
var FillOutMessage = "Please fill out";//field name or 'this field' will be appended to this with a space.
var RangeMessage = "Please input a value between";//field min and max attribute value will be appended to this.
var LengthMessage = "Input character should be between";//field min and max attribute value will be appended to this.
var OptionGroupMessage = "Please select at least one option";
///*{0} will be replaced with the actual message later on before displaying.*/
var MessageTag = "<span class='help-block' id='help-block'>{0}</span>";
var SuccessClass = "has-success";
var ErrorClass = "has-error";
var HelpBlockSelector = ".help-block";
var ClosestTagSelector = ".form-group";

var args = {
    invalidEmail: "",
    invalidNumber: "",
    invalidPhone:"",
    invalidOption:"",
    invalidCheckbox:"",
    fillOut:"",
    invalidRange:"",
    invalidLength:"",
    invalidGroupOption:"",
    successClass:"",
    errorClass:"",
    closestTagSelector:"",
    messageWrapperTag: "<span class='help-block' id='help-block'></span>"
};

Element.prototype.validateForm = function (args) {

    if (args !== undefined) {
        //override variable values if provided and not empty
        if (args.invalidEmail !== undefined && args.invalidEmail !== '') EmailMessage = args.invalidEmail;
        if (args.invalidNumber !== undefined && args.invalidNumber !== '') NumberMessage = args.invalidNumber;
        if (args.invalidPhone !== undefined && args.invalidPhone !== '') PhoneMessage = args.invalidPhone;
        // if (args.invalidOption !== undefined && args.invalidOption !== '') OptionMessage = args.invalidOption;
        if (args.invalidCheckbox !== undefined && args.invalidCheckbox !== '') CheckboxMessage = args.invalidCheckbox;
        if (args.fillOut !== undefined && args.fillOut !== '') FillOutMessage = args.fillOut;
        if (args.invalidRange !== undefined && args.invalidRange !== '') RangeMessage = args.invalidRange;
        if (args.invalidLength !== undefined && args.invalidLength !== '') LengthMessage = args.invalidLength;
        if (args.invalidGroupOption !== undefined && args.invalidGroupOption !== '') OptionGroupMessage = args.invalidGroupOption;
        //insert {0} in between wrapper tag that will be replaced with actual message later on before displaying.
        if (args.messageWrapperTag !== undefined && args.messageWrapperTag !== '') MessageTag = args.messageWrapperTag.replace("></", ">{0}</");
        if (args.successClass !== undefined && args.successClass !== '') SuccessClass = args.successClass;
        if (args.errorClass !== undefined && args.errorClass !== '') ErrorClass = args.errorClass;
        if (args.closestTagSelector !== undefined && args.closestTagSelector !== '') ClosestTagSelector = args.closestTagSelector;
    }

    var form = this;
    this.addEventListener("invalid", function (event) {
        event.preventDefault();
    }, true);
    // Support Safari, iOS Safari, and the Android browser—each of which do not prevent
    // form submissions by default
    this.addEventListener("submit", function (event) {
        if (!this.checkValidity()) {
            event.preventDefault();
        }
    });
    //********************************************** for blur event of each control
    var allControls = this.querySelectorAll("input:not([type='submit']):not([name$='[]']), select, textarea");
    for (var i = 0; i < allControls.length; i++) {
        var input = allControls[i];
        //bind blur event for every field in the form
        input.addEventListener("blur", function (event) {
            //get parent of object
            var inputParent = event.target.parentNode;
            //Following if block is only for styled select boxes and custom date picker
            if (inputParent.classList.contains('old') || inputParent.classList.contains('date')) {
                inputParent = inputParent.closest(ClosestTagSelector)
            }

            //get help block and remove it if already added.
            var spanError = inputParent.querySelector(HelpBlockSelector);
            if (spanError) {
                inputParent.removeChild(spanError);
                inputParent.closest(ClosestTagSelector).classList.remove(ErrorClass);
                inputParent.closest(ClosestTagSelector).classList.add(SuccessClass);
            }
            //validate the current field and based on result add/remove the error message
            if (!event.target.validity.valid) {
                inputParent.closest(ClosestTagSelector).classList.add(ErrorClass);
                inputParent.closest(ClosestTagSelector).classList.remove(SuccessClass);
                inputParent.insertAdjacentHTML("beforeend", MessageTag.replace("{0}", GetMessage(event.target)));
            } else {
                inputParent.classList.remove(ErrorClass);
            }
        });
    }

    //get input type checkbox(s) that belongs to a group with name attribute
    var onlyCheckBoxGroups = this.querySelectorAll("input[name$='[]']");
    var checkBoxArray = [];
    var checkBoxNames = [];
    var singleName = '';
    //iterate checkboxes and prepare a list of group names and their relevant checkboxes
    for (var i = 0; i < onlyCheckBoxGroups.length; i++) {
        if (singleName !== onlyCheckBoxGroups[i].name) {
            if (checkBoxNames.length > 0) {
                checkBoxArray.push(checkBoxNames);
                checkBoxNames = [];
            }
            singleName = onlyCheckBoxGroups[i].name;
        }
        checkBoxNames.push(onlyCheckBoxGroups[i]);
        if ((onlyCheckBoxGroups.length - 1) === i) {
            checkBoxArray.push(checkBoxNames);
            checkBoxNames = [];
        }
    }
    for (var j = 0; j < checkBoxArray.length; j++) {
        var checkBoxes = checkBoxArray[j];
        var groupParent = checkBoxes[j].parentNode;
        //bind change and blur event foreach checkbox whose parent has attribute required
        if (groupParent.getAttribute('required') != null) {
            for (i = 0; i < checkBoxes.length; i++) {
                checkBoxes[i].addEventListener("change", function (event) {
                    checkBoxGroupValidate(event)
                });
                checkBoxes[i].addEventListener("blur", function (event) {
                    //get the next element that get focus after the recently triggered blur event
                    if (event.relatedTarget) {
                        //and if the next element is member of another group or another item then validate value
                        //for previous group
                        if (event.target.getAttribute('name') !== event.relatedTarget.getAttribute('name')) {
                            checkBoxGroupValidate(event);
                        }
                    }
                });
            }
        }
    }

    /*
    * This function validates the value for a checkbox group that is marked required.
    */
    function checkBoxGroupValidate(event) {
        //get all checked checkboxes for a group and if its null then mark it invalid or valid
        var totalChecked = event.target.parentNode.querySelector("input[name$='[]']:checked");
        if (totalChecked === null) {
            var errorMessage = '';
            if(event.target.dataset.requireError){
                errorMessage = event.target.dataset.requireError;
            }else if(event.target.parentNode.dataset.requireError){
                errorMessage = event.target.parentNode.dataset.requireError;
            }else {
                errorMessage = OptionGroupMessage;
            }
            event.target.parentNode.classList.remove(SuccessClass);
            event.target.parentNode.classList.add(ErrorClass);
            if (event.target.parentNode.querySelector(HelpBlockSelector) === null) {
                event.target.parentNode.insertAdjacentHTML("beforeend", MessageTag.replace("{0}", errorMessage));
            }
        } else {
            event.target.parentNode.classList.remove(ErrorClass);
            event.target.parentNode.classList.add(SuccessClass);
            var spanError = event.target.parentNode.querySelector(HelpBlockSelector);
            if (spanError !== null) {
                event.target.parentNode.removeChild(spanError)
            }
        }
    }

    //****************************************** for click event of submit button
    var submitButton = this.querySelector("input[type=submit]");
    submitButton.addEventListener("click", function (event) {
        var errors = 0;
        for (var j = 0; j < checkBoxArray.length; j++) {
            var checkBoxes = checkBoxArray[j];
            var groupParent = checkBoxes[j].parentNode;
            if (groupParent.getAttribute('required') != null) {
                var totalChecked = groupParent.querySelector("input[name$='[]']:checked");
                if (totalChecked === null) {
                    errors++;

                    groupParent.classList.remove(SuccessClass);
                    var errorMessage = groupParent.querySelector("input[name$='[]']").getAttribute('data-requireError');
                    groupParent.classList.add(ErrorClass);
                    if (groupParent.querySelector(HelpBlockSelector) === null) {
                        groupParent.insertAdjacentHTML("beforeend", MessageTag.replace("{0}", errorMessage));
                    }
                }
            }
        }
        var invalidFields = form.querySelectorAll(":invalid:not(fieldset)"),
            errorMessages = form.querySelectorAll(HelpBlockSelector),
            myParent;

        // Remove any existing messages
        for (var i = 0; i < errorMessages.length; i++) {
            //errorMessages[ z ].parentNode.removeChild( errorMessages[ z ] );
        }
        for (var i = 0; i < invalidFields.length; i++) {
            myParent = invalidFields[i].parentNode;
            //Following if block is only for styled select boxes
            if (myParent.classList.contains('old') || myParent.classList.contains('date')) {
                myParent = myParent.closest(ClosestTagSelector)
            }
            var spanError = myParent.querySelector(HelpBlockSelector);
            if (spanError) {
                myParent.removeChild(spanError);
                myParent.closest(ClosestTagSelector).classList.remove(ErrorClass);
            }
            if (!invalidFields[i].validity.valid) {
                myParent.closest(ClosestTagSelector).classList.add(ErrorClass);
                myParent.insertAdjacentHTML("beforeend", MessageTag.replace("{0}", GetMessage(invalidFields[i])));
            } else {
                myParent.closest(ClosestTagSelector).classList.remove(ErrorClass);
            }
        }

        // If there are errors, give focus to the first invalid field
        if (invalidFields.length > 0) {
            invalidFields[0].focus();
        } else {
            if (errorMessages.length === 0) {
                this.submit();
            } else {
                event.preventDefault();
            }
        }
    });
};

/**
 * @return {string}
 */
function GetMessage(element) {
    //the data attribute with multiple dashes(-) will be obtained using camelCase conversion i.e data-abc-def corresponds to the key abcDef
    //If data-requireError or data-patternError are defined
    if (element.dataset.requireError || element.dataset.patternError) {
        if (element.validity.valueMissing === true) {
            return element.dataset.requireError;
        }
        else {
            return element.dataset.patternError;
        }
    } else {
        //if error message are not defined via data attributes then use default OR generic messages.
        var name = element.nodeName,
            type = element.type;
        //assign name to type variable if element is not an input element to use within switch case
        if (name !== 'INPUT') {
            type = name;
        }
        var errorMessageToShow = '';
        switch (type) {
            case 'email':
                if (element.validity.typeMismatch === true) {
                    errorMessageToShow = EmailMessage;
                } else {
                    errorMessageToShow = element.validationMessage;
                }
                break;
            case 'tel':
                if (element.validity.typeMismatch === true) {
                    errorMessageToShow = PhoneMessage;
                } else {
                    errorMessageToShow = element.validationMessage;
                }
                break;
            case 'SELECT':
            case 'radio':

                if (element.validity.valueMissing === true && m=== true ) {

                    alert(m);

                    errorMessageToShow = OptionMessage;
                }
                else {
                    errorMessageToShow = element.validationMessage;
                }
                break;
            case 'checkbox':
                if (element.validity.valueMissing === true) {
                    errorMessageToShow = CheckboxMessage;
                } else {
                    errorMessageToShow = element.validationMessage;
                }
                break;
            default:
                if (element.validity.valueMissing === true) {
                    /* Required field left blank. */
                    errorMessageToShow = FillOutMessage + ((element.name) ? (' ' + element.name + '.') : ' this field.');
                } else if (element.validity.typeMismatch === true) {
                    /* element's value is invalid per its type attribute */
                    errorMessageToShow = element.validationMessage;
                } else if (element.validity.patternMismatch === true) {
                    /* element's value does not match its pattern attribute */
                    if (element.pattern === '\d*') {
                        errorMessageToShow = NumberMessage;
                    } else {
                        errorMessageToShow = element.validationMessage;
                    }
                } else if (element.validity.rangeOverflow === true || element.validity.rangeUnderflow === true) {
                    /*element's value does not match its min/max attribute*/
                    var max = element.getAttribute('max'),
                        min = element.getAttribute('min');
                    errorMessageToShow = RangeMessage + " " + min + "-" + max + ".";
                } else if (element.validity.tooLong === true || element.validity.tooShort === true) {
                    //element's value not match with minimum/maximum length attribute
                    var maxLength = element.getAttribute('maxlength'),
                        minLength = element.getAttribute('minlength');
                    errorMessageToShow = LengthMessage + " " + minLength + "-" + maxLength + ".";
                } else if (element.validity.stepMismatch === true) {
                    errorMessageToShow = element.validationMessage;
                } else {
                    /* Default message. */
                    errorMessageToShow = element.validationMessage;
                }
                break;
        }
        return errorMessageToShow;
    }
}

Iam stuck that where i should change that.

i can change the validation. but this validation is good for me and in most of the forms i applied this. just for only two forms iam facing due to hidden fields. if i need to change the validation package. then i need to change it for all form. thats why i am stressing in this same form.

i think everyone understood the question. sorry for these much toooo large question

Kindly some one help please. 2 days i am sitting with this problem.

AbdulBazith started a new conversation Barryvdh/laravel-dompdf Not Installing In My Project

Guys iam working with a project job portal site.

In job seeker module i need resume building. i got enough information from the user.

Now i need to build resume. so i decided to use barryvdh/laravel-dompdf package for building resume.

iam unable to install barryvdh/laravel-dompdf package.

when i use

composer require barryvdh/laravel-dompdf

it shows error

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for barryvdh/laravel-dompdf ^0.8.3 -> satisfiable by                                                                                         barryvdh/laravel-dompdf[v0.8.3].
    - Conclusion: remove laravel/framework v5.4.36
    - Conclusion: don't install laravel/framework v5.4.36
    - barryvdh/laravel-dompdf v0.8.3 requires illuminate/support 5.5.x|5.6.x|5.7                                                                                        .x -> satisfiable by illuminate/support[v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.2                                                                                        8, v5.5.33, v5.5.34, v5.5.35, v5.5.36, v5.5.37, v5.5.39, v5.5.40, v5.5.41, v5.5.                                                                                        43, v5.5.44, v5.6.0, v5.6.1, v5.6.10, v5.6.11, v5.6.12, v5.6.13, v5.6.14, v5.6.1                                                                                        5, v5.6.16, v5.6.17, v5.6.19, v5.6.2, v5.6.20, v5.6.21, v5.6.22, v5.6.23, v5.6.2                                                                                        4, v5.6.25, v5.6.26, v5.6.27, v5.6.28, v5.6.29, v5.6.3, v5.6.30, v5.6.31, v5.6.3                                                                                        2, v5.6.33, v5.6.34, v5.6.35, v5.6.36, v5.6.37, v5.6.38, v5.6.39, v5.6.4, v5.6.5                                                                                        , v5.6.6, v5.6.7, v5.6.8, v5.6.9, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.                                                                                        7.2, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9].
    - don't install illuminate/support v5.5.0|don't install laravel/framework v5                                                                                        .4.36
    - don't install illuminate/support v5.5.16|don't install laravel/framework v                                                                                        5.4.36
    - don't install illuminate/support v5.5.17|don't install laravel/framework v                                                                                        5.4.36
    - don't install illuminate/support v5.5.2|don't install laravel/framework v5                                                                                        .4.36
    - don't install illuminate/support v5.5.28|don't install laravel/framework v                                                                                        5.4.36
    - don't install illuminate/support v5.5.33|don't install laravel/framework v                                                                                        5.4.36
    - don't install illuminate/support v5.5.34|don't install laravel/framework v                                                                                        5.4.36
    - don't install illuminate/support v5.5.35|don't install laravel/framework v                                                                                        5.4.36
    - don't install illuminate/support v5.5.36|don't install laravel/framework v                                                                                        5.4.36
    - don't install illuminate/support v5.5.37|don't install laravel/framework v                                                                                        5.4.36
    - don't install illuminate/support v5.5.39|don't install laravel/framework v                                                                                        5.4.36
    - don't install illuminate/support v5.5.40|don't install laravel/framework v                                                                                        5.4.36
    - don't install illuminate/support v5.5.41|don't install laravel/framework v                                                                                        5.4.36
    - don't install illuminate/support v5.5.43|don't install laravel/framework v                                                                                        5.4.36
    - don't install illuminate/support v5.5.44|don't install laravel/framework v                                                                                        5.4.36
    - don't install illuminate/support v5.6.0|don't install laravel/framework v5                                                                                        .4.36
    - don't install illuminate/support v5.6.1|don't install laravel/framework v5                                                                                        .4.36
    - illuminate/support v5.6.10 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.11 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.12 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.13 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.14 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.15 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.16 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.17 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.19 conflicts with laravel/framework[v5.4.36].
    - don't install illuminate/support v5.6.2|don't install laravel/framework v5                                                                                        .4.36
    - illuminate/support v5.6.20 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.21 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.22 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.23 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.24 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.25 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.26 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.27 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.28 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.29 conflicts with laravel/framework[v5.4.36].
    - don't install illuminate/support v5.6.3|don't install laravel/framework v5                                                                                        .4.36
    - illuminate/support v5.6.30 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.31 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.32 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.33 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.34 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.35 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.36 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.37 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.38 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.39 conflicts with laravel/framework[v5.4.36].
    - don't install illuminate/support v5.6.4|don't install laravel/framework v5                                                                                        .4.36
    - don't install illuminate/support v5.6.5|don't install laravel/framework v5                                                                                        .4.36
    - don't install illuminate/support v5.6.6|don't install laravel/framework v5                                                                                        .4.36
    - don't install illuminate/support v5.6.7|don't install laravel/framework v5                                                                                        .4.36
    - illuminate/support v5.6.8 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.6.9 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.7.0 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.7.1 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.7.10 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.7.11 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.7.15 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.7.2 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.7.3 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.7.4 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.7.5 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.7.6 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.7.7 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.7.8 conflicts with laravel/framework[v5.4.36].
    - illuminate/support v5.7.9 conflicts with laravel/framework[v5.4.36].
    - Installation request for laravel/framework (locked at v5.4.36, required as                                                                                         5.4.*) -> satisfiable by laravel/framework[v5.4.36].


Installation failed, reverting ./composer.json to its original content.



this the error it was showing.

when i reffered in net most of them said to verify my composer.json file has dom-pdf with lower version.

but i didnt find anything like that in my composer.json file.

even i searched in my composer.lock file in that also nothing is there.

this is my composer.json file

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.6.4",
        "filp/whoops": "^2.2",
        "intervention/image": "^2.4",
        "laravel/framework": "5.4.*",
        "laravel/tinker": "~1.0",
        "uxweb/sweet-alert": "^2.0"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~5.7"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\": "app/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\": "tests/"
        }
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\Foundation\ComposerScripts::postInstall",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "Illuminate\Foundation\ComposerScripts::postUpdate",
            "php artisan optimize"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true
    }
}


My laravel projecr version is


Laravel Framework 5.4.36

almost my project is completed.. Now i cant install that barryvdh/laravel-dompdf package.

What should i do. Kindly some one help please..

29 Nov
2 weeks ago

AbdulBazith left a reply on My Hidden Input Fields Also Validated In Javascript How To Solve

@michaelcharles thank you for your suggestion..

you are right.

but some times i need to hide the textbox and it should not be validated.

what should i do??

AbdulBazith left a reply on How To Check If Values Are Repeated From Controller Laravel

@snapey are u busy..

Kindly when u are free means refer this please.

AbdulBazith left a reply on My Hidden Input Fields Also Validated In Javascript How To Solve

@realrandyallen thank you for your response.

Even if i use ignore:hidden.

it is validating

28 Nov
2 weeks ago

AbdulBazith started a new conversation My Hidden Input Fields Also Validated In Javascript How To Solve

Guys iam working with a project.

iam using native-validations-master downloaded it from net.

to perform validation i need to attach the form-validation.js file in my project and then,

in my form


document.getElementById('experience_form').validateForm();

//where experience_form is my form name and validateForm is function name in the validation js file

my problem is i have hidden input fields in this form. those also validated so that i cant subit the form.

if that input fields are visible then only it must be validated. how to do that?

i searched in net and did this


  document.getElementById('experience_form').validateForm(
        {
         ignore: "#hidden"
         }
  );


i referred in net but most of the solutions are based on jquery

but not worked. what can i do

Kindly some one help please..

AbdulBazith left a reply on Laravel Import Excel To Database Package.

@kshitizmittal ya u can try Maatwesbite.

This packages can be used for both import and export..

27 Nov
2 weeks ago

AbdulBazith left a reply on Can I Have A User Defined Table For Authentication In Laravel?

@gurur sorry for late response and thank you for your reply

actually the login and logout process is done manually..

i used manual controllers for this login and logout .

then it is possible to use separate table for authentication

AbdulBazith left a reply on Login Procedure User() Shows Error

@munazzil @gurur thank you guys for your response.. and very sorry for the delay.

this works

@if( auth()->check()) && (Auth::user()->user_type == "job seeker")

because first it check that user is logged in then only it proceeds.

other than the above code

@if (auth()->user()->user_type == "job seeker")

@if(Auth::user()->user_type == "job seeker" && auth()->check())

the above both not works because it not checks first..

and thank you guys for you response. i forgot that && can be added in @if condtion.

and once again sorry for late response

AbdulBazith left a reply on How To Check If Values Are Repeated From Controller Laravel

@snapey very sorry for these much days delay.

Just now i tried , first i cant alert the variable returned from controller

just i tried this

alert({{$education_details_edit->education}}); even this shows error.

i unable to predict where to check it.

this is my js

var educationobject = {

    "SSLC" : {

        "CBSE": ["English Medium", "Tamil Medium", "Other"],

        "CISCE(ICSE/ISC)": ["English Medium", "Tamil Medium", "Other"],

        "Matriculation": ["English Medium", "Tamil Medium", "Other"],

        "State Board": ["English Medium", "Tamil Medium", "Other"],

        "Other": ["Other"],
    },


"Other" : {

        "Other": ["Other"],
    },


actually i have three drop downs.

1st drop down posess SSLC`` andOther```

if SSLC is selected then next dropdown changes to

CBSE,CISCE(ICSE/ISC),Matriculation,State Board these options will be displayed

then if CBSE is selected then the third dropdown changes English Medium, Tamil Medium, Other

this is the loop for that.. education = my first dropdown name

course_or_board= my second dropdown name

specialization_or_medium= my third drop down name


window.onload = function () {
    var education = document.getElementById("education"),
        course_or_board = document.getElementById("course_or_board"),
        specialization_or_medium = document.getElementById("specialization_or_medium");
    for (var edu in educationobject) {
        education.options[education.options.length] = new Option(edu, edu);
    }
    education.onchange = function () {
        course_or_board.length = 1; // remove all options bar first
        specialization_or_medium.length = 1; // remove all options bar first
        if (this.selectedIndex < 1) return; // done
        for (var course in educationobject[this.value]) {
            course_or_board.options[course_or_board.options.length] = new Option(course, course);
        }
    }
    education.onchange(); // reset in case page is reloaded
    course_or_board.onchange = function () {
        specialization_or_medium.length = 1; // remove all options bar first
        if (this.selectedIndex < 1) return; // done
        var special = educationobject[education.value][this.value];
        for (var i = 0; i < special.length; i++) {
            specialization_or_medium.options[specialization_or_medium.options.length] = new Option(special[i], special[i]);
        }
    }
}



here where can i check the condition which is returned from the controller.

Kindly help mee...

and the below mentioned are data returned from controller. which i need to check with the three drop downs.


{{$education_details_edit->education}}  = my controller return which contains education column data

{{$education_details_edit->course_or_board}} =  my controller return which contains course_or_board column data

{{$education_details_edit->specialization_or_medium}} =  my controller return which contains specialization_or_medium column data

24 Nov
2 weeks ago

AbdulBazith left a reply on How To Return Data From Ajax To Select Tag

@vinubangs try this

change you ajax like this

 <script type="text/javascript">
    $(document).ready(function () {
        $(document).on('change', '.courses_name', function () {

            var courses_name = $(this).val();
            $.ajax({
                dataType: 'json',
                type: 'get',
                url: '{!! URL::to('
                findbranch ') !!}',
                data: {
                    'courses_name': courses_name
                },

                success: function (data) {
                    //  console.log('success');
                    //  console.log(data);

                    if (data) {
                        $("#branch_name").empty();
                        $("#branch_name").append('<option>Select Branch</option>');
                        $.each(data, function (key, value) {

                            $("#branch_name").append('<option value="' + value[
                                    "branchname"] + '">' + value["branchname "] +
                                '</option>');
                        });
                    }
                },

                error: function () {

                    console.log('fail');
                    alert("fail");

                }

            });

        });

    });
</script>

and make your controller


$branchname  = branchname(your model)::select('branchname(your branch column name)')->where('courses_name(your course column name)',$request->courses_name)->get();

    return response()->json($branchname  );

iam using like this only. it worked for mee

Try this

23 Nov
3 weeks ago

AbdulBazith started a new conversation Doubt In Wordpress Woocommerce Site

Guys this is a doubt in wordpress.

If this question is irrelavent to this forum community kindly forgive me. I apologize for that. sorry

my friend is developing a project for a online gym shop.

its a woo commerce site and he is developing in word press.

he used sports bike theme to develop this project.

Almost completed the project.

But he have a small doubt

this is his page link: http://demotry.xyz/product/sole-f63/

in this the product is a combo product

the product data is: Combo product

both the product share same id

When the customer clicks the ADD CART button. both the products moves to the cart because that is combo product.

he need another button same as add to cart. when customer clicks that button only one product must move to cart.

that is the product is combo product. but customer can choose the option like if customer needs only the one product customer can ad to cart else if customer need both as combo then customer can do that also.

Refer this link: https://www.solefitness.sg/product/sole-f63/5/show/

In above link if customer clicks the add cart button only one product is added to cart. and below if customer clicks Add all 2 to carts. then both the products as combo added to the cart.

how to achieve this.

so how can do this?

he planned to write a separate php file. but he struck in the coding.

so he asked me the doubt. iam not familiar with wordpress.. but i too searched in google for manual php file .

but i cant understand. i cant find the php code for the add to cart button.

in the form tag the action is action="http://demotry.xyz/product/sole-f63/".. i cant find the php file which adds it into cart.

iam unable to find where the php is written for add to cart button. how the value is taken into the cart i cant find

For this, is there any plugin or can i manually write code. is it possible. what should i do Kindly help me..

Suggest some links please to solve this problem..

Once again If this question is irrelavent to this forum community kindly forgive me. I apologize for that. sorry

AbdulBazith started a new conversation Can I Have A User Defined Table For Authentication In Laravel?

Guys iam working with a project job portal site.

i have competed my job seeker module.

in my user table what i had is

id
first_name
Last_name
user_type(seeker/employer)
type(fresher/Experience)
email
mobile
phno
password

these are the fields i have in my user table.

now i need to to register the employer.

is the same table can i use else

i can make another table.

if i create another table for employer registration say for example employer_registration table. does any problem occurs in future.

can i use this @if( auth()->check()) for this table also

and for checking normally i use this @if(Auth::user()->user_type == "job seeker")

if i create a new table can i do this

@if(Auth::employer_registration()->user_type == "employer")

am i right??

else its better to have only user table

else only user table will support the authentication

Kindly suggest your ideas please

AbdulBazith started a new conversation Login Procedure User() Shows Error

Guys iam working with project job portal site.

I am facing a small problem with the before login.

this below code is used to check whether a user is logged in or not

  @if( auth()->check())

this works fine no problem in this

Now the below code is to fetch the data(specific column) from the user table and to check the condition

  @if(Auth::user()->user_type == "job seeker")

This also works fine. this checks the condition if the user_type column is job seeker or not. But this does not checks whether the user logged in or not.

if i use the above code without login it shows error message

Trying to get property 'user_type' of non-object

I understood that due to the user doesn't login it cant see the column user_type

so what i did is

@if( auth()->check())
  @if(Auth::user()->user_type == "job seeker")


if i do the above code it works fine,, checks weather the user is logged in and then check the value in the columnuser_type

Is there any code which does both the user is logged in and then check the value or else i need to write like the above only?

Kindly some one suggest yourideas

22 Nov
3 weeks ago

AbdulBazith left a reply on How To Check If Values Are Repeated From Controller Laravel

@snapey thank you for you reply...

s good idea.. i didnt think that..

Let me try that..

AbdulBazith left a reply on How To Check If Values Are Repeated From Controller Laravel

@danyal14 thank you for your response.

Actually that's not my doubt.. everthing works fine.. a user comes, first he enters his first education details 10th std.. then it is saved in db as a row in that user id.

next the form is loaded, so he can enter his next education 12 th std so second row. like this it moves on..

to be clear whats my doubt is, when the inserted data comes to edit, the drop down values is displayed twice

so how to rectify it..

if the dropdown down also from db then we can write a simple check condition which i mentioned above.

but ny drop down is fetched from js file so how can i check it,,

AbdulBazith left a reply on Suggest A Good Idea For Resume Building Module In Laravel

@ahmeddabak thank you for your response...

Is that the only way,,

but when i refer in net it showing few packages..

21 Nov
3 weeks ago

AbdulBazith started a new conversation Suggest A Good Idea For Resume Building Module In Laravel

Guys iam working with a project job portal site.

I have a module RESUME BUILDING.

through forms i got all the enough information from the seeker.

Now i need to make a resume with that whole information so that seeker as well as employer can download it as PDF.

Kindly some one suggest a good idea, do i need to work for it or is there any package.

Actually what i decided is to use barryvdh/laravel-dompdf just i planned

But in this the alignment and such other things are not available.

Is this is the way, else is there any package for resume building.

Kindly suggest links and videos to refer please guys..

AbdulBazith left a reply on Foreign Key Data Retrieve Showing Error In Laravel

@snapey very sorry sorry sorry for late reply today only i tried this

actually iam listing all the seekers details.. so that employer can see it.. if employer needs a filter like only 'experienced' or only 'BE' graduates or only "specific location" candidates. so i have three text box and a search button.

1 textbox for location, anther for frehser/experienced another for graduate.

So if a employer needs only Indian employees so he will type India in that location search box and if he clicks search button only Indian seekers are listed.

If a user needs Indian seekers with BE graduates but fresher. then he will fill all the three textbox and then he clicks the search button the that filtered list must be displayed..

how can i do that please help mee

consider that my three search box name is education, type, location.

and it moves to controller search(Request $request) method..

this is my normal code which lists all the seekers. this works fine.

   $seekers=User::orderBy('created_at','desc')->where('is_accepted', '=', '0')->paginate(5);

        $seekers->load(['education','language', 'certification','skillset','experience','career','project']);      

        return view('Viewss.seekers-list')->withSeekers($seekers);

But when it comes to filter i used


$seekers=User::where(function ($query) use ($request)
        {
        
            $query->Where('type', 'LIKE', '%' . $request->type '%');
              

    })->orderBy('created_at','asc')->paginate(5);    

    $seekers->load(['education','language', 'certification','skillset','experience','career','project']);

    return view('Viewss.seekers-list')->withSeekers($seekers);


But you said that better to use whereHas

so with that i tired like this is this right.


$seekers=User::whereHas('education',function($query) use ($request)
         {
            $query->Where('course_or_board', 'LIKE', '%' . $request->education . '%');

    })->whereHas('address',function($query) use ($request)
    {
       $query->Where('c_city', 'LIKE', '%' . $request->location . '%');

})-> orderBy('created_at','asc')->where('is_accepted', '=', '0')->paginate(5);

    $seekers->load(['education','language', 'certification','skillset','experience','career','project']);

    return view('Viewss.seekers-list')->withSeekers($seekers);

but its not correctly filtering. andif i need to filter the user table means what should i do. the type of seeker(fresher/experineced) is in user table only.

Kindly help and suggest idea please

AbdulBazith started a new conversation How To Check If Values Are Repeated From Controller Laravel

Guys iam working working with a project job portal site..

i have the education details as javascript (education.js) file.

so in my drop down the education list are displayed from that education.js file.

so a user selects the education then it is stored in the edcation_table.

Everything works fine.

But the problem is in edit the form.

when i need to edit the education detail i wll fetch the edcuation details from the db and place it in form to edit. so while placing it the value in db is also there and the values from the education.js file is also there.the values are duplicated.

Say for example if a user enter his education as 'PG' which is choosed from drop down. it enters in db. when he tries to edit that the db data 'PG' also displayed at the same time the js file PG also displayed . how to check it.

Actually in my old project what i did is the drop down details also stored in db, so that i easy checked and eliminated the duplication.

but now the education list is loaded from js file so how can i check.

this is my code which i use in my old project

this is my controller

 $education_details_edit = Education_details::find($id);
     return view('Edit-seeker-forms.edit-education-details')
        ->withEducation_details_edit($education_details_edit);


 <select class="form-control capitalize"id="education" name="education" required>     

                                <option style="display: {{$education_details_edit->education == "doubt" ? 'none' : ''}}" value='{{$education_details_edit->education}}'>{{$education_details_edit->education}}</option>
                            
                        </select>

Here in the place doubt i need to place a the js id so that it checks. but how i can do that.

In my old project what i did is in the place of doubt i used the variable which is picked from another table that has the drop down values.

Kindly some one help please..

this is my education.js file


var educationobject = {
   
    "Maters/PG": {
        "CA": ["CA","Pursuing","First Attempt","Second Attempt","Other"],

        "CS":["CS","Other"],       

        "MVSC":["Veterinary Science","Other"],

        "MCM":["Computers and Management","Other"],

        "MDS":["Dentistry","Other"],

        "MFA":["Sculpture","Printmaking","Visual Communication","Other"],     

    },
 
}

some one please help

AbdulBazith left a reply on How To Display Specific Column Value In Collection Laravel

@m7vm7v thank you for your response.. and sorry for late response

19 Nov
3 weeks ago

AbdulBazith started a new conversation How To Display Specific Column Value In Collection Laravel

Guys iam working with a project job portal site.

this is my controller to fetch all records of all users with relationship.



        $seekers=User::orderBy('created_at','desc')->where('is_accepted', '=', '0')->paginate(5);

        $seekers->load(['education','language', 'certification','skillset','experience','career','project']);     

        return view('Viewss.seekers-list')->withSeekers($seekers);


this returns all the values from all models.

Now whats my doubt , here a user can have more than one education, that is Abdul bazith can have 10th,12th, UG and PG.

how the tableeducation looks like is a row for abdul bazith for 10th another rowfor abdul bazith for 12th like this goes on.

so a user has n number of rows based on their education.

Now whats my doubt is i have displayed the details in view.blade file.


   @foreach($seeker->education as $edu)

                                        {{ $edu->course_or_board}}

                                        @endforeach


this displays all the rows of 'course_or_board'. but what i need is specifically a single values in that course_or_board.

@foreach($seeker->education as $edu) this contains values such as 10th,12th,UG,PG

so what i need is to display that PG only.. speicifc value in a column in a collection $seekers

How can i do that, Kindly some one help please..

14 Nov
1 month ago

AbdulBazith left a reply on Foreign Key Data Retrieve Showing Error In Laravel

@snapey having a smal doubt..

this is my normal index method which list all the seekers to employer


 $seekers=User::orderBy('created_at','asc')->paginate(5);

 $seekers->load(['education','language', 'certification','skillset','experience','career','project']);

  return view('Viewss.seekers-list')->withSeekers($seekers);

i have a search button when it is clicked it moves to controller search method and in that method i have written,

    $seekers=User::where(function ($query) use ($request)
        {
            if (!empty($request->experience)) {
            $query->Where('type', 'LIKE', '%' . $request->experience . '%');
            }          

    })->orderBy('created_at','asc')->paginate(5);    

    $seekers->load(['education','language', 'certification','skillset','experience','career','project']);

    return view('Viewss.seekers-list')->withSeekers($seekers);


the above code works fine. because $query->Where('type', 'LIKE', '%' . $request->experience . '%'); here type is column of user table. so it filtered correctly.

But if i need to search based on the education table column or skill set column or language column means what should i do??

$seekers is array collection so when i filter with user table columns it works, but if i need to filter the education table or the 'education','language', 'certification','skillset','experience','career','project' means what should i do??

Kindly reply please