/** * Run the database seeds. * * @return void */ public function run() { Model::unguard(); $seeds = [['content_type_id' => 1, 'name' => 'Uncategorized']]; foreach ($seeds as $seed) { Category::create($seed); } Model::reguard(); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $content = Content::find($id); $contentTypes = ['' => 'Select Content Type'] + ContentType::lists('name', 'id')->toArray(); $categories = ['' => 'Select Category'] + Category::lists('name', 'id')->toArray(); $languages = ['' => 'Select Language'] + Language::lists('code', 'id')->toArray(); $statuses = ['' => 'Select Status', 'draft' => 'Draft', 'pending' => 'Pending', 'approved' => 'Approved', 'active' => 'Active']; return view('contents.edit', compact('content', 'contentTypes', 'categories', 'languages', 'statuses')); }