I have this function or the user will add a 'tarificationtaches' to the 'technicien' each 'technicien' have a single 'tarificationtaches'for a selected 'tache' I wanted to make a select to check if the 'technician_id' and the 'tache_id' already exist in the pricing table stain but I have this error
(""Call to undefined function App\Http\Controllers\technicien()")
this is my function
public function store(Request $request)
{
$tarification = new tarificationtache();
$tarification ->tache_id = $request->input('tache_id');
$tarification ->Tarif =$request->input('Tarif');
$tarification->technicien_id = $request->input('technicien_id');
$tarification = DB::select("select * FROM tarificationtaches where
technicien_id = 'technicien_id' and tache_id = input('tache_id')");
if(request($tarification) > 1)
echo "Ce technicien a cette tarification";
else{
$tarification->save();
}
tabel tarificationtaches
Schema::create('tarificationtaches', function (Blueprint $table) {
$table->increments('id');
$table->float('tarif', 8,2);
$table->integer('tache_id')->unsigned();
$table->foreign('tache_id')->references('id')->on('taches');
$table->integer('technicien_id')->unsigned();
$table->foreign('technicien_id')->references('id')-
>on('techniciens');
$table->datetime('deleted_at')->nullable();
$table->timestamps();
});
via Chebli Mohamed

Aucun commentaire:
Enregistrer un commentaire