LoginSignup
0
0

More than 5 years have passed since last update.

Laravel 構築

Last updated at Posted at 2017-08-17

専用ページを読み込み

@include('project.environments-field', [
    'title' => '渡すタイトル',
    'servers' => $servers['test'],
    'environment' => $environments['test'],
])

エラーの時、ボックスの色が変わる

<div class="form-group {{ $errors->has('department_id') ? 'has-error' : '' }}">

進んで、戻るボータンをしたら、元の値が消えないように

<select class="form-control" name="department_id" id="department_id">
    <option value="">選択してください</option>
    @foreach($departments as $department)
        <option value="{{ $department->id }}" {{ old('department_id') == $department->id ? 'selected' : '' }}>{{ $department->name }}</option>
    @endforeach
</select>

配列をviewに返す時。compact

$environments['production'] = Environment::where('name', 'production')->first();
$fileTypes = FileType::all();
        return view('admin/project/create', compact(
            'departments',
            'environments',
            'servers',
            'osUsers',
            'fileTypes'
        ));
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0