im new in laravel. I have a problem on my app version 5.2.45
I having Missing argument 1 for App\Http\Controllers\PhotoController::create() when i try to pass variable to view with information from database:
Route:
Route::get('photo/create/{id}', 'PhotoController@create');
Controller:
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use DB;
use Session;
class PhotoController extends Controller { private $table = 'photos';
// Show Create Form
public function create($gallery_id) {
// render view
return view('photo.create', compact('gallery_id'));
}
View:
@section('content')
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h1>Upload photo</h1>
{!! Form::open(array('action' => 'PhotoController@store', 'enctype' => 'multipart/form-data')) !!}
<input type="hidden" name="gallery_id" value="">
{!! Form::close() !!}
</div>
</div>
@endsection
via Dmitry Malys