Answers for "laravel pass data to controller"

PHP
1

how to pass data to controller in laravel

$dept = DB::table('master_department')->get();
$design = DB::table('master_designation')->get();
return view('registration', ['dept' => $dept], compact('design'));

#if we send as array
@foreach($dept as $key=>$d)
	{{ $dept[$key]->dept_title }}
@endforeach

#if we send as compact object
@foreach($design as $deg)
	<option value="{{ $deg->id }}">{{ $deg->deg_title }}</option>							
@endforeach
Posted by: Guest on February-03-2021
1

how to pass data to controller in laravel

$dept = DB::table('master_department')->get();
$design = DB::table('master_designation')->get();
return view('registration', ['dept' => $dept], compact('design'));

#if we send as array
@foreach($dept as $key=>$d)
	{{ $dept[$key]->dept_title }}
@endforeach

#if we send as compact object
@foreach($design as $deg)
	<option value="{{ $deg->id }}">{{ $deg->deg_title }}</option>							
@endforeach
Posted by: Guest on February-03-2021
0

passing data from controller to blade view laravel

Route::get('eventpage', 'EventController@index')->name('eventpage');
Posted by: Guest on July-14-2020
0

passing data from controller to blade view laravel

Route::get('eventpage', 'EventController@index')->name('eventpage');
Posted by: Guest on July-14-2020
0

how to directly transfer data from html to controller in laravel

public function users(Request $request)
{
    $name = $request->input('firstname'); // This is better than using $_POST
    $lastname = $request->input('lastname');

    DB :: table("newUsers") -> insertGetId
    (
        array("firstname" => $name, "lastname" => $lastname, "email" => "test")
     );

    return view("pages.users");
}
Posted by: Guest on February-10-2021
0

how to directly transfer data from html to controller in laravel

public function users(Request $request)
{
    $name = $request->input('firstname'); // This is better than using $_POST
    $lastname = $request->input('lastname');

    DB :: table("newUsers") -> insertGetId
    (
        array("firstname" => $name, "lastname" => $lastname, "email" => "test")
     );

    return view("pages.users");
}
Posted by: Guest on February-10-2021

Code answers related to "laravel pass data to controller"

Browse Popular Code Answers by Language