Questions tagged as 'laravel'

1
answer

How to define the semantics of packages downloaded with composer?

I created some PHP packages with composer help as a dependency manager and made it available in Packagist ( link ). p> After uploading the packages, I installed them inside a Laravel project. For this I used the following statement: compose...
asked by 16.11.2016 / 23:18
2
answers

Object property coming from JSON is not accessible

I'm working with framework Laravel on versão 5.2 I'm developing a API where I have a Painel administrativo that produces and manages content, in this case produto , and I have another site that will consume...
asked by 10.10.2016 / 15:38
1
answer

How to get records from a table when there is no relationship with another table in Laravel?

In Laravel, when I want to get data from a table that contains some relationship, or when I want to get the data from a condition in a related table, for example, usuarios containing livros , I use the methods has or wher...
asked by 06.05.2016 / 22:50
1
answer

Laravel 5.2 pages redirecting to POST without showing validation errors

In laravel 5 whenever I try to send a post to save or edit the data, a redirection occurs in all requests with status 302. This is occurring on any system page where I make a POST to insert the data into the database. I'm using% cus...
asked by 06.05.2016 / 16:26
1
answer

Order collection of products interleaving according to flag

I have a model called Product which has, in addition to the product data, a featured flag that says whether the products are highlighted or not. At the time of mounting the view the products should be displayed according to the fol...
asked by 25.01.2017 / 15:58
1
answer

Laravel - validate input arrays and return values in case of error

I am creating form using the following code: In the create.blade.php file {!! Form::open(['route'=>'orcamentos.store']) !!} {!! Form::text('descricao', null, ['class'=>'form-control', 'autofocus']) !!} {!! Form::text('produto[]', null...
asked by 01.06.2016 / 04:09
1
answer

Watermark on image in laravel 5.2

Hello, does anyone know how I could do that every image that is uploaded in laravel has a watermark? The image is sent by a form and through $request->file('img') in the controller I add in the folder and the name of the image in...
asked by 01.09.2016 / 07:39
1
answer

Carbon diffInDays does not bring the negative value between two dates (positive only) [closed]

$datNow = Carbon::parse('2018-10-23 18:40:11.000000'); $datSuspensao = Carbon::parse('2018-10-18 00:00:00.390176'); $diasRestantes = $datSuspensao->diffInDays($datNow); dd($diasRestantes); //Imprime 5 (Na verdade queria imprimir -5) $datNow...
asked by 23.10.2018 / 14:22
1
answer

Relationship in Laravel / Eloquent ORM

I have a problem. I need to return the values of a relationship, however, it has the following error: ErrorException Undefined property: Illuminate\Database\Eloquent\Collection::$fileServico My code: FileClass.php public function fileS...
asked by 05.06.2014 / 05:36
4
answers

Formatting date with Laravel

I can not change the date format using laravel 5.4 My model looks like this: class Feriado extends Model{ protected $fillable = ['id', 'data', 'descricao', 'created_at', 'updated_at' ]; protected $dates = ['data'=> 'm-d-Y...
asked by 27.10.2017 / 04:06