Dropzone with laravel

I am using dropzone.js with laravel to upload photos, it works perfectly.
I also added remove link for each photo. during uploading process I change the name of photo using time(). and save it into database.

My question is how I can get the new name of photo , so I can use it when I want to remove it using dropzone.js

Many thanks and best regards,


Source: stackoverflow-php

Laravel – only a zero is saved to the database

I have a simple car model with one attribute:

<?php

namespace App;

use IlluminateDatabaseEloquentModel;
use IlluminateFilesystemFilesystem;

/*
*   TODO:
*   Property Fotos ausf├╝llen
*/

class Car extends Model
{
    //Tablenname
    protected $table = 'cars';

    protected $fillable = ['title'];

    public $timestamps = false;

    /**
    *   @var string
    */
    protected $title = NULL;

    /**
    *   @var integer
    */
    protected $imagesId = NULL;

    /**
    *
    *   @return string
    */
    public function getTitle()
    {
        return $this->attributes['title'];
    }


    /**
    *
    *   @param string $title
    *
    *   @return void
    */
    public function setTitle($title)
    {
        $this->attributes['title'] = $title;
    }

}

This is my store function from the controller:

/**
 * Store a newly created resource in storage.
 *
 * @param  IlluminateHttpRequest  $request
 * @return IlluminateHttpResponse
 */
public function store(Request $request)
{       
    $car = new Car();

    // $car->setTitle($request->title);
    $car->setTitle('stackoverflow');
    $car->save();

    ...
 }

However, this is how the entry in the database looks like:

enter image description here

Title is always zero! I also tried it with other models, same.


Source: stackoverflow-php