0

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');
    }
Maximilian Peters
  • 30,348
  • 12
  • 86
  • 99
Alisha
  • 1
  • Try this http://stackoverflow.com/questions/6859018/save-data-in-arabic-in-mysql-database – Amit Gupta Nov 11 '16 at 05:41
  • This one i tried. But then also the arabic language is saved as تاي بنت into databse. How to get à´•à´¶àµà´®àµ€à´ this kind of format into my laravel phpmyadmin? – Alisha Nov 11 '16 at 05:49

0 Answers0