SunnyBoy

SunnyBoy

Business Analyst at Ideosis Technologies Inc.

Member Since 1 Year Ago

Calgary

Experience Points
15,780
Total
Experience

4,220 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
145
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 4
15,780 XP
Dec
05
1 week ago
Activity icon

Replied to Custom Artisan Command To Execute Multiple Commands

@sinnbeck Oops! 😂😂😂Thanks again!!!

Activity icon

Started a new Conversation Custom Artisan Command To Execute Multiple Commands

I know, it might sound weird as this can be done easily using batch file, but just curious... 😯😈đŸŠčđŸ»â€â™‚ïž Wondering if there is a way to execute the following, using custom artisan command.

E.g. Run this command

php artisan all:clear

To execute these

php artisan cache:clear
php artisan route:clear
php artisan config:clear
php artisan view:clear
Dec
03
1 week ago
Nov
20
3 weeks ago
Activity icon

Commented on Object-Oriented Forms: Part 1

I guess there is this similar issue in episode 29, the errors are not getting displayed on screen.

<template>
  <div class="box">
    <form @submit.prevent="onSubmit" @keydown="form.errors.clear()">
      <div class="field">
        <label class="label">Message</label>
        <div class="control">
          <textarea class="textarea" placeholder="I have someting to say..." v-model="form.body"></textarea>
          <p class="help is-danger" v-if="form.errors.has('body')" v-text="form.errors.get('body')"></p>
        </div>
      </div>

      <div class="field is-grouped">
        <div class="control">
          <button class="button is-primary" :disabled="form.errors.any()">Submit</button>
        </div>
        <div class="control">
          <button class="button is-link is-light">Cancel</button>
        </div>
      </div>
    </form>
  </div>
</template>
<script>
export default {
  data() {
    return { form: new Form({ body: "" }) };
  },
  methods: {
    onSubmit() {
      this.form
        .post("/statuses")
        .then(status => this.$emit("completed", status));
    }
  }
};
</script>
Nov
19
3 weeks ago
Activity icon

Commented on Dedicated Form Components

It's what (vue on laravel) I have been trying to learn for quite sometime. Thanks... Nicely explained... I followed the entire video but at the very end around 13:00 where the error messages are displayed for some reason I am not able to display those. I do get the data in 422 message but it's not getting display on screen.... any ideas or suggestion would be appreciated!!!

Here is my code:

<template>
  <div class="box">
    <form @submit.prevent="onSubmit" @keydown="form.errors.clear()">
      <div class="field">
        <label class="label">Message</label>
        <div class="control">
          <textarea class="textarea" placeholder="I have someting to say..." v-model="form.body"></textarea>
          <p class="help is-danger" v-if="form.errors.has('body')" v-text="form.errors.get('body')"></p>
        </div>
      </div>

      <div class="field is-grouped">
        <div class="control">
          <button class="button is-primary" :disabled="form.errors.any()">Submit</button>
        </div>
        <div class="control">
          <button class="button is-link is-light">Cancel</button>
        </div>
      </div>
    </form>
  </div>
</template>
<script>
export default {
  data() {
    return { form: new Form({ body: "" }) };
  },
  methods: {
    onSubmit() {
      this.form
        .post("/statuses")
        .then(status => this.$emit("completed", status));
    }
  }
};
</script>

Nov
14
1 month ago
Activity icon

Replied to Adldap2-Laravel With Windows Active Directory

@sadi78 Thanks for the tip, but this issue is already resolved. Appreciated

Oct
26
1 month ago
Activity icon

Awarded Best Reply on Adldap2-Laravel With Windows Active Directory

@sinnbeck Here is my working code setup what I have, I tried all I could:

.env (ldap variables)

LDAP_HOSTS=xxx.xxx.xx.xx // to be replaced
LDAP_BASE_DN="DC=example,DC=com" // to be replaced
LDAP_USER_ATTRIBUTE=samaccountname 
LDAP_USER_FORMAT=%[email protected] // to be replaced
LDAP_CONNECTION=default

LDAP_USERNAME=username // to be replaced with admin or user with lookup permission
LDAP_PASSWORD=password

config\auth.php

...

    'providers' => [
        'users' => [
            'driver' => 'ldap', // was 'eloquent'
            'model' => App\User::class,
        ],
    ],

...

ldap.php // don't have change anything

<?php

return [

    'logging' => env('LDAP_LOGGING', false),

    'connections' => [

        'default' => [
            'auto_connect' => env('LDAP_AUTO_CONNECT', false),
            'connection' => Adldap\Connections\Ldap::class,
            'settings' => [
    
                'schema' => Adldap\Schemas\ActiveDirectory::class,
                'account_prefix' => env('LDAP_ACCOUNT_PREFIX', ''),
                'account_suffix' => env('LDAP_ACCOUNT_SUFFIX', ''),
                'hosts' => explode(' ', env('LDAP_HOSTS', 'corp-dc1.corp.acme.org corp-dc2.corp.acme.org')),
                'port' => env('LDAP_PORT', 389),
                'timeout' => env('LDAP_TIMEOUT', 5),
                'base_dn' => env('LDAP_BASE_DN', 'ou=corp,dc=acme,dc=org'),
                'username' => env('LDAP_USERNAME', ''),
                'password' => env('LDAP_PASSWORD', ''),
                'follow_referrals' => env('LDAP_FOLLOW_REFERRALS', false),
                'use_ssl' => env('LDAP_USE_SSL', false),
                'use_tls' => env('LDAP_USE_TLS', false),
            ],
        ],
    
    ],

];

ldap_auth.php

<?php

return [

    'connection' => env('LDAP_CONNECTION', 'default'),

// Yes, I am using DatabaseUserProvider cause my users table has items related to

    'provider' => Adldap\Laravel\Auth\DatabaseUserProvider::class,

    'model' => App\User::class,

    'rules' => [

        Adldap\Laravel\Validation\Rules\DenyTrashed::class,

    ],

    'scopes' => [

    ],

    'identifiers' => [

        'ldap' => [

            'locate_users_by' => 'sAMAccountName',

            'bind_users_by' => 'distinguishedname',

        ],

        'database' => [

            'guid_column' => 'objectguid',

            'username_column' => 'username',

        ],

        'windows' => [

            'locate_users_by' => 'sAMAccountName',

            'server_key' => 'AUTH_USER',

        ],

    ],

    'passwords' => [

        'sync' => env('LDAP_PASSWORD_SYNC', false),

        'column' => 'password',

    ],

    'login_fallback' => env('LDAP_LOGIN_FALLBACK', false),

    'sync_attributes' => [

        'name' => 'cn',
        
        'email' => 'userPrincipalName',
        
        'username' => 'sAMAccountName',
    ],

    'logging' => [

        'enabled' => env('LDAP_LOGGING', true),

        'events' => [

            \Adldap\Laravel\Events\Importing::class => \Adldap\Laravel\Listeners\LogImport::class,
            \Adldap\Laravel\Events\Synchronized::class => \Adldap\Laravel\Listeners\LogSynchronized::class,
            \Adldap\Laravel\Events\Synchronizing::class => \Adldap\Laravel\Listeners\LogSynchronizing::class,
            \Adldap\Laravel\Events\Authenticated::class => \Adldap\Laravel\Listeners\LogAuthenticated::class,
            \Adldap\Laravel\Events\Authenticating::class => \Adldap\Laravel\Listeners\LogAuthentication::class,
            \Adldap\Laravel\Events\AuthenticationFailed::class => \Adldap\Laravel\Listeners\LogAuthenticationFailure::class,
            \Adldap\Laravel\Events\AuthenticationRejected::class => \Adldap\Laravel\Listeners\LogAuthenticationRejection::class,
            \Adldap\Laravel\Events\AuthenticationSuccessful::class => \Adldap\Laravel\Listeners\LogAuthenticationSuccess::class,
            \Adldap\Laravel\Events\DiscoveredWithCredentials::class => \Adldap\Laravel\Listeners\LogDiscovery::class,
            \Adldap\Laravel\Events\AuthenticatedWithWindows::class => \Adldap\Laravel\Listeners\LogWindowsAuth::class,
            \Adldap\Laravel\Events\AuthenticatedModelTrashed::class => \Adldap\Laravel\Listeners\LogTrashedModel::class,

        ],
    ],

];

Auth\LoginController.php

<?php

namespace App\Http\Controllers\Auth;

use Illuminate\Http\Request;
use Adldap\Laravel\Facades\Adldap;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;

class LoginController extends Controller
{
    use AuthenticatesUsers;

    protected $redirectTo = '/home';

    public function __construct()
    {
        $this->middleware('guest')->except('logout');
    }

    public function username()
    {
        return 'username';
    }

    protected function validateLogin(Request $request)
    {
        $this->validate($request, [
            $this->username() => 'required|string|regex:/^[A-Za-z]+\.[A-Za-z]+$/',
            'password' => 'required|string',
        ]);
    }

    protected function attemptLogin(Request $request)
    {
        
        $credentials = $request->only($this->username(), 'password');
        $username = $credentials[$this->username()];
        $password = $credentials['password'];

        $user_format = env('LDAP_USER_FORMAT');
        $userdn = sprintf($user_format, $username);
        
        if (Adldap::auth()->attempt($userdn, $password, $bindAsUser = true)) {

            $user = \App\User::where($this->username(), $username)->first();
            
            if (!$user) {
                
                $user = new \App\User();
                $user->username = $username;
                $user->password = '';

                $sync_attrs = $this->retrieveSyncAttributes($username);
                foreach ($sync_attrs as $field => $value) {
                    $user->$field = $value !== null ? $value : '';
                }
            }

            $this->guard()->login($user, true);
            return true;
        }
        // the user doesn't exist in the LDAP server or the password is wrong
        // log error
        return false;
    }

    protected function retrieveSyncAttributes($username)
    {
        $ldapuser = Adldap::search()->where(env('LDAP_USER_ATTRIBUTE'), '=', $username)->first();
        if (!$ldapuser) {
            // log error
            return false;
        }
        
        $ldapuser_attrs = null;

        $attrs = [];

        foreach (config('ldap_auth.sync_attributes') as $local_attr => $ldap_attr) {
            if ($local_attr == 'username') {
                continue;
            }

            $method = 'get' . $ldap_attr;
            if (method_exists($ldapuser, $method)) {
                $attrs[$local_attr] = $ldapuser->$method();
                continue;
            }

            if ($ldapuser_attrs === null) {
                $ldapuser_attrs = self::accessProtected($ldapuser, 'attributes');
            }

            if (!isset($ldapuser_attrs[$ldap_attr])) {
                // an exception could be thrown
                $attrs[$local_attr] = null;
                continue;
            }

            if (!is_array($ldapuser_attrs[$ldap_attr])) {
                $attrs[$local_attr] = $ldapuser_attrs[$ldap_attr];
            }

            if (count($ldapuser_attrs[$ldap_attr]) == 0) {
                // an exception could be thrown
                $attrs[$local_attr] = null;
                continue;
            }

            $attrs[$local_attr] = $ldapuser_attrs[$ldap_attr][0];
            //$attrs[$local_attr] = implode(',', $ldapuser_attrs[$ldap_attr]);
        }

        return $attrs;
    }

    protected static function accessProtected($obj, $prop)
    {
        $reflection = new \ReflectionClass($obj);
        $property = $reflection->getProperty($prop);
        $property->setAccessible(true);
        return $property->getValue($obj);
    }
}
Oct
12
2 months ago
Activity icon

Replied to Adldap2-Laravel With Windows Active Directory

@sinnbeck Here is my working code setup what I have, I tried all I could:

.env (ldap variables)

LDAP_HOSTS=xxx.xxx.xx.xx // to be replaced
LDAP_BASE_DN="DC=example,DC=com" // to be replaced
LDAP_USER_ATTRIBUTE=samaccountname 
LDAP_USER_FORMAT=%[email protected] // to be replaced
LDAP_CONNECTION=default

LDAP_USERNAME=username // to be replaced with admin or user with lookup permission
LDAP_PASSWORD=password

config\auth.php

...

    'providers' => [
        'users' => [
            'driver' => 'ldap', // was 'eloquent'
            'model' => App\User::class,
        ],
    ],

...

ldap.php // don't have change anything

<?php

return [

    'logging' => env('LDAP_LOGGING', false),

    'connections' => [

        'default' => [
            'auto_connect' => env('LDAP_AUTO_CONNECT', false),
            'connection' => Adldap\Connections\Ldap::class,
            'settings' => [
    
                'schema' => Adldap\Schemas\ActiveDirectory::class,
                'account_prefix' => env('LDAP_ACCOUNT_PREFIX', ''),
                'account_suffix' => env('LDAP_ACCOUNT_SUFFIX', ''),
                'hosts' => explode(' ', env('LDAP_HOSTS', 'corp-dc1.corp.acme.org corp-dc2.corp.acme.org')),
                'port' => env('LDAP_PORT', 389),
                'timeout' => env('LDAP_TIMEOUT', 5),
                'base_dn' => env('LDAP_BASE_DN', 'ou=corp,dc=acme,dc=org'),
                'username' => env('LDAP_USERNAME', ''),
                'password' => env('LDAP_PASSWORD', ''),
                'follow_referrals' => env('LDAP_FOLLOW_REFERRALS', false),
                'use_ssl' => env('LDAP_USE_SSL', false),
                'use_tls' => env('LDAP_USE_TLS', false),
            ],
        ],
    
    ],

];

ldap_auth.php

<?php

return [

    'connection' => env('LDAP_CONNECTION', 'default'),

// Yes, I am using DatabaseUserProvider cause my users table has items related to

    'provider' => Adldap\Laravel\Auth\DatabaseUserProvider::class,

    'model' => App\User::class,

    'rules' => [

        Adldap\Laravel\Validation\Rules\DenyTrashed::class,

    ],

    'scopes' => [

    ],

    'identifiers' => [

        'ldap' => [

            'locate_users_by' => 'sAMAccountName',

            'bind_users_by' => 'distinguishedname',

        ],

        'database' => [

            'guid_column' => 'objectguid',

            'username_column' => 'username',

        ],

        'windows' => [

            'locate_users_by' => 'sAMAccountName',

            'server_key' => 'AUTH_USER',

        ],

    ],

    'passwords' => [

        'sync' => env('LDAP_PASSWORD_SYNC', false),

        'column' => 'password',

    ],

    'login_fallback' => env('LDAP_LOGIN_FALLBACK', false),

    'sync_attributes' => [

        'name' => 'cn',
        
        'email' => 'userPrincipalName',
        
        'username' => 'sAMAccountName',
    ],

    'logging' => [

        'enabled' => env('LDAP_LOGGING', true),

        'events' => [

            \Adldap\Laravel\Events\Importing::class => \Adldap\Laravel\Listeners\LogImport::class,
            \Adldap\Laravel\Events\Synchronized::class => \Adldap\Laravel\Listeners\LogSynchronized::class,
            \Adldap\Laravel\Events\Synchronizing::class => \Adldap\Laravel\Listeners\LogSynchronizing::class,
            \Adldap\Laravel\Events\Authenticated::class => \Adldap\Laravel\Listeners\LogAuthenticated::class,
            \Adldap\Laravel\Events\Authenticating::class => \Adldap\Laravel\Listeners\LogAuthentication::class,
            \Adldap\Laravel\Events\AuthenticationFailed::class => \Adldap\Laravel\Listeners\LogAuthenticationFailure::class,
            \Adldap\Laravel\Events\AuthenticationRejected::class => \Adldap\Laravel\Listeners\LogAuthenticationRejection::class,
            \Adldap\Laravel\Events\AuthenticationSuccessful::class => \Adldap\Laravel\Listeners\LogAuthenticationSuccess::class,
            \Adldap\Laravel\Events\DiscoveredWithCredentials::class => \Adldap\Laravel\Listeners\LogDiscovery::class,
            \Adldap\Laravel\Events\AuthenticatedWithWindows::class => \Adldap\Laravel\Listeners\LogWindowsAuth::class,
            \Adldap\Laravel\Events\AuthenticatedModelTrashed::class => \Adldap\Laravel\Listeners\LogTrashedModel::class,

        ],
    ],

];

Auth\LoginController.php

<?php

namespace App\Http\Controllers\Auth;

use Illuminate\Http\Request;
use Adldap\Laravel\Facades\Adldap;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;

class LoginController extends Controller
{
    use AuthenticatesUsers;

    protected $redirectTo = '/home';

    public function __construct()
    {
        $this->middleware('guest')->except('logout');
    }

    public function username()
    {
        return 'username';
    }

    protected function validateLogin(Request $request)
    {
        $this->validate($request, [
            $this->username() => 'required|string|regex:/^[A-Za-z]+\.[A-Za-z]+$/',
            'password' => 'required|string',
        ]);
    }

    protected function attemptLogin(Request $request)
    {
        
        $credentials = $request->only($this->username(), 'password');
        $username = $credentials[$this->username()];
        $password = $credentials['password'];

        $user_format = env('LDAP_USER_FORMAT');
        $userdn = sprintf($user_format, $username);
        
        if (Adldap::auth()->attempt($userdn, $password, $bindAsUser = true)) {

            $user = \App\User::where($this->username(), $username)->first();
            
            if (!$user) {
                
                $user = new \App\User();
                $user->username = $username;
                $user->password = '';

                $sync_attrs = $this->retrieveSyncAttributes($username);
                foreach ($sync_attrs as $field => $value) {
                    $user->$field = $value !== null ? $value : '';
                }
            }

            $this->guard()->login($user, true);
            return true;
        }
        // the user doesn't exist in the LDAP server or the password is wrong
        // log error
        return false;
    }

    protected function retrieveSyncAttributes($username)
    {
        $ldapuser = Adldap::search()->where(env('LDAP_USER_ATTRIBUTE'), '=', $username)->first();
        if (!$ldapuser) {
            // log error
            return false;
        }
        
        $ldapuser_attrs = null;

        $attrs = [];

        foreach (config('ldap_auth.sync_attributes') as $local_attr => $ldap_attr) {
            if ($local_attr == 'username') {
                continue;
            }

            $method = 'get' . $ldap_attr;
            if (method_exists($ldapuser, $method)) {
                $attrs[$local_attr] = $ldapuser->$method();
                continue;
            }

            if ($ldapuser_attrs === null) {
                $ldapuser_attrs = self::accessProtected($ldapuser, 'attributes');
            }

            if (!isset($ldapuser_attrs[$ldap_attr])) {
                // an exception could be thrown
                $attrs[$local_attr] = null;
                continue;
            }

            if (!is_array($ldapuser_attrs[$ldap_attr])) {
                $attrs[$local_attr] = $ldapuser_attrs[$ldap_attr];
            }

            if (count($ldapuser_attrs[$ldap_attr]) == 0) {
                // an exception could be thrown
                $attrs[$local_attr] = null;
                continue;
            }

            $attrs[$local_attr] = $ldapuser_attrs[$ldap_attr][0];
            //$attrs[$local_attr] = implode(',', $ldapuser_attrs[$ldap_attr]);
        }

        return $attrs;
    }

    protected static function accessProtected($obj, $prop)
    {
        $reflection = new \ReflectionClass($obj);
        $property = $reflection->getProperty($prop);
        $property->setAccessible(true);
        return $property->getValue($obj);
    }
}
Oct
11
2 months ago
Activity icon

Replied to Adldap2-Laravel With Windows Active Directory

@sinnbeck I tried all possible ways but no luck! Can you share your LoginController please? Thanks

Oct
10
2 months ago
Activity icon

Replied to Adldap2-Laravel With Windows Active Directory

Thanks for the response, last night I tried the solution but it din't work need to check with the active directory admin regarding the permissions. Will update as soon I get the confirmation on the account, but ya so far no luck. I tried you solution but it seems I am still missing something.

Oct
09
2 months ago
Activity icon

Replied to How To Join Laravel 5.4 To Windows Active Directory Server?

Can you share your ldap.php and ldap_auth.php please!

Activity icon

Replied to Adldap2-Laravel With Windows Active Directory

@sinnbeck: thanks for the heads-up but as i mentioned I am new to LDAP, how would that look like in config.ldap? Regarding the account for lookup i think it is all set by the admin as it is being used in other projects in the company.

I would really appreciate if you can share some your AD settings!

Thanks

Activity icon

Started a new Conversation Adldap2-Laravel With Windows Active Directory

Hi Laravel Gurus,

I'm new to LDAP and for a project, the requirement is to use username instead of email for authentication. For username authentication i need to connect to the company's active directory.

I tried this https://github.com/jotaelesalinas/laravel-simple-ldap-auth which works perfectly as the way it should with OpenLDAP, but when i am trying the same with the company's Active Directory using my credentials it throws error "Invalid Credentials". There is no issue with the credentials, I'm able to connect using AD Explorer (LDAP Browser).

Does anyone know what needs to be configured differently? Do I need to change something to connect to Active Directory? Is it something to do with the structure of the directory?

PLEASE HELP!!!

Thanks

Oct
06
2 months ago
Activity icon

Replied to How To Handle The Value That Is No More In Dropdown List?

@nakov and @snapey: Thanks for the quick response... my bad i didn't explain the issue clearly. What i am trying is:

I have a list of users based on the user status, if the user is retired then the user's name doesn't show up in the list. (this is easy and straight forward)

But when i want to edit a record which has this missing user name then I want to display that name as the selected option in my dropdown but its not there in the list.

I did the simple fix (as in my above comment) and it works, but wondering is this the best solution?

Activity icon

Replied to How To Handle The Value That Is No More In Dropdown List?

This is something i have done as work around (simple fix) and it works, but wondering will it be a full proof???

<select class="form-control" name="mySelect" required>
    // d is the historical data that is already in the db
    <option value="d">d</option>
@foreach
..... a
    <option value="b" selected>b</option>
..... c 
@endfoeach
</select>
Activity icon

Started a new Conversation How To Handle The Value That Is No More In Dropdown List?

Here is my problem: In Laravel 6, i have a required element with the current options let say a, b, c:

<select class="form-control" name="mySelect" required>
    <option value="a">a</option>
    <option value="b">b</option>
    <option value="c">c</option>
</select>

However, say d was a valid option previously and was saved to my back-end database. So now when I load my page, I'm setting mySelect to what is stored in the database but the select element is empty because d isn't an option anymore.

How can I make it so my select element as Invalid if it has a value that is not a valid option?

Oct
03
2 months ago
Activity icon

Replied to Lock Screen Implement In Laravel 5.7

@pro_raheel Did you find the solution yet???

Sep
14
3 months ago