I want to migrate a file in MySQL database but I can't seem to get the data type of the file right in Laravel. Help if you can please
I have read Link but it does not solve my problem.
I am a beginner so kindly be patient with me if you find this question immature (We all must start from somewhere remember)
An excerpt of my migration is below:
public function up()
{
Schema::create('student', function (Blueprint $table) {
$table->id();
**$table->string('file');**
$table->string('semester');
$table->timestamps();
});
}
this is my request file also
{
return [
'file' => 'required',
'semester' => 'required|string|max:255',
];
}
This is also my controller file
public function store(CEStoreRequest $request)
{
CE::create([
'file' => $request->file('file'),
'semester' => $request->semester,
]);
return redirect()->route('home.index')->with('success', 'Project created successfully');
}