• 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

Array to string conversion

How to install PHP composer inside a docker container

how to see if database exists with PDO [duplicate]

I need to link Google Sheet with my Laravel

How avoid Moved Permanently The document has moved here

Phalcon: setStatusCode returns empty response

Laravel/ PHP: Order By Alphabetical with numbers in order [duplicate]

Combine multiple columns into an array as one of the key in a results set

How to add a heading in between checkout fields of WooCommerce

Add a custom text for a particular product on specific email notification in Woocommerce

Query Optimization, changing the queries in the loop into a single processing query

Star and Half Star Rating in Laravel

How can I get data from PHP to Android TextView?

How to install LDAP in Docker php-fpm alpine

Laravel Unknown Column 'updated_at'

About Contact Privacy policy Terms and conditions