inital commit
This commit is contained in:
29
app/Http/Controllers/TechnoTransportController.php
Normal file
29
app/Http/Controllers/TechnoTransportController.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\TechnoTransport;
|
||||
|
||||
class TechnoTransportController extends Controller
|
||||
{
|
||||
public function addTechnoTransport(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'file' => 'required|mimes:doc,pdf,docx'
|
||||
]);
|
||||
|
||||
|
||||
$file = $request->file('file')->store('technotransport');
|
||||
|
||||
// $techno_transport = new TechnoTransport();
|
||||
$techno_transport = TechnoTransport::create($request->all());
|
||||
$techno_transport->file = $file;
|
||||
$techno_transport->save();
|
||||
|
||||
return response()->json([
|
||||
'status' => 200,
|
||||
'data' => $techno_transport
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user