• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Laravel : How to Create Dropdown to Select FOREIGN KEY from Other Table?

phpmysqllaravel


PHP Snippet 1:

public function create()
{
    $doas =  Doas::all();

    return view('note/create', compact('doas'));
}

PHP Snippet 2:

<div class="container">
    <label class="form-label text-white" style="font-weight: bold;" for="doa">Doa terkait</label>
    <select class="form-select" style="color: #41A7A5" aria-label="Default select example">
        @foreach ($doas as $doa)
            <option value="{{$doa-id>}}">{{$doa->name}}</option>
        @endforeach
    </select>
</div>

Related Snippets

Laravel 5.2: Unable to locate factory with name [default]

Insert multidimensional array to codeigniter cart

How to create laravel storage symbolic link for production or sub domain system?

phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO)

Laravel dosen't connect with Oracle

target [LaravelFortifyContractsRegisterViewResponse] is not instantiable

PHP 8.1: strftime() is deprecated

Pass a select with mysqli_fetch_row to a table

PHP Include for HTML?

Laravel MSSQL Server Connection not working

Convert date and time to Jalali in Laravel

How can I solve "laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system"?

carbon generated datetime not stored correctly into the database

How to put php code inside opening and closing shortcodes

GRPC installed successfully on ubuntu but php is looking for it in another folder

About Contact Privacy policy Terms and conditions