I want to save my Arabic language field as encoded format into database. now it showing like تي بتب into that database. I want the format like à´¨àµà´¯àµ‚à´¡à´²àµâ€à´¹à´¿: പാകൠഅധീന à´•à´¶àµà´®àµ€à´°à´¿à´²àµâ€ ഇനàµà´¤àµà´¯ നടതàµà´¤à´¿à.
The collation and charset i set like charset=>'utf8' collation=>'utf8_unicode_ci' and my table fields also utf8_unicode_ci.
This is my model -
namespace App;
use Illuminate\Database\Eloquent\Model;
class FillingCategory extends Model
{
protected $fillable=['category','category_arabic'];
}
This is insertion code that i used in this project. Only two fields are there. The field name called category_arabic is a text field that text want to show like à´•à´¶àµà´®àµ€à´ inside the database.
public function store(Request $request) {
$this->validate($request, [
'category' => 'required',
'category_arabic' => 'required'
]);
$fillingCategory = new FillingCategory(['category'=>$request->category,'category_arabic'=>$request->category_arabic]);
$status = $fillingCategory -> save();
if ($status) {
$statusLabel = "success";
$statusMsg = "Filling category added successfully.";
} else {
$statusLabel = "danger";
$statusMsg = "Some thing went wrong! Please try again.";
}
flash_status($statusLabel, $statusMsg);
return redirect('admin/filling_category');
}