Laracountries
:earth_africa: Migration and seed files with all countries for Laravel PHP Framework
Install / Use
/learn @fabiofdsantos/LaracountriesREADME
Laracountries
Migration and seed files with all countries for Laravel PHP Framework.
The country codes are in the format ISO 3166-1 alpha-2.
A Simple Example of Use (Laravel 5)
Model
<?php
use Illuminate\Database\Eloquent\Model;
class Country extends Model
{
protected $table = 'countries';
public $timestamps = false;
}
Controller
/**
* Show the form for creating a new resource.
*
* @return View
*/
public function create()
{
$countries = Country::all();
return view('myview', compact('countries'));
}
View
<select class="form-control" name="country">
<option value="">Select a country</option>
@foreach($countries as $country)
<option value="{{ $country->id }}">{{ $country->name }}</option>
@endforeach
</select>
License
See the LICENSE file for license rights and limitations (MIT).
Related Skills
node-connect
352.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
