I wonder why I keep failing saving data. I keep getting this message:

"please fill the title and content article" - eventhough I already fill them in.


     <div class="backend-form create-article-form" style="display:none;">
                                <div class="form-top">
                                    <div class="form-left">
                                        <h4>Create Article</h4>
                                    <div class="form-right">
                                        <a href="#" class="btn-save-article setting_save"></a>
                                        <a href="#" class="btn-cancel-article setting_cancel"></a>
                                <div class="form-body">
                                    <div class="form-group">
                                        <span>Tittle</span><input type="text" name="tittle" id="tittle" class="tittle" required/>


                                    <div class="form-group">
                                                <textarea rows="10" maxlength="1000" id="content" class="content"></textarea>

        var tittle = $("#tittle").val(),
        content = $("#content").val();

            method: "POST",
            url: '{{action("AjaxController@postCreateArticle")}}',
            data: { tittle : tittle, content : content },

            success: function (response) {
                if (response=='"error"') {
                    pesanErr("please fill the title and content article");
                pesanOk("Article created");



 public function postCreateArticle(Request $request)
    $domain = $_SERVER['SERVER_NAME'];
    $user = User::where('domain', $domain)->first();

    if ($user) {
        $domain = $_SERVER['SERVER_NAME'];
        $user = User::where('domain', $domain)->first();

        $tittle = $request->input("tittle");
        $content = $request->input("content");

        if (empty($tittle) or empty($content)) {
            $message = "error";
        } else {

            $article = new Timeline;
            $article->user_id = $user['id'];
            $article->social_id = $user['id'];
            $article->tittle = $tittle;
            $article->content = $content;
            $article->status = "0";
            $article->updated_at = ("0000-00-00 00:00:00");
            $article->social = "article";
            $act = $article->save();

            if ($act) {
                $message = "success";
            } else {
                $message = "error";
        echo json_encode($message);


the AJAX request seems fine and the server side too. It could be a mistype, I see in the form you set tittle with two Ts, are you sure it's the same in the database table?

$article->tittle = $tittle;

If that's okay, see if Laravel error log helps.

In addition to what cereal said, have you tried outputting tittle and content to the console, just to be sure they are not empty there?