Hi i am new to laravel i have 3 forms ie customer ,service,contact all have different tables like customer ,service,contact i need to do insert for these in database in laravel.
<form action="service_info" method="POST">
@csrf
<div class="input-w">
<label class="label-style">Service Type:</label>
<span><select class="form-control" required >
<option type="brillare">Brillare</option>
<option type="hair">Hair</option>
</select></span>
</div>
<div class="input-w">
<label name="service_name">Service Name:</label>
<span><input id="service_name" name="service_name" class="form-control" placeholder="Service Name" required ></span>
</div>
<div class="input-w">
<label name="service_price">Service Price:</label>
<span><input type="number" id="service_price" name="service_price" class="form-control" required placeholder="0000.00"></span>
</div>
<div align="center" class="button_style">
<p style="margin:15px -40px 20px 182px"><input type="submit" name="submit" id="submit_service" value="Submit" class="btn btn-outline-success"></p>
</div>
</form>
service form
Route::get('/service', function () {
return view('service');
});
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class ServiceTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('service', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('servicetype');
$table->string('servicename');
$table->string('serviceprice');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('service');
}
}
and
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class ServiceController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
return view("service");
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//
return "test";
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
i need service form insert to service table customer form insert to customer table contact form insert to contact table in laravel 5.8
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire