Questions tagged as 'laravel'

1
answer

Software Licensing

I'm developing a system that uses Apache server, Laravel, Mysql etc. Well, I would like to license this system, and my question is if I can do this and if so, what kind of license should I use, given the technologies I am using to have their...
asked by 08.11.2015 / 02:01
2
answers

Laravel BelongsToMany

I have a user table that makes relationship with profile belongsTo , and the profile makes relationship with items from area belongsToMany , and items from area makes relationship with area belongsTo , it is bringing my item fr...
asked by 09.12.2014 / 17:58
1
answer

What is the difference between Model :: lists () and Model :: all () - lists () in Laravel?

In Laravel , we have a method that we can list fields of a table in the key-value style. I can do this in two ways So: Usuario::lists('nome', 'id'); And So: Usuario::all()->lists('nome', 'id'); The result would be: [1...
asked by 17.02.2016 / 11:47
2
answers

I can not extract information from Json in Laravel

I get a request like this ... public function store(Request $request) { return response()->json($request->all()); } The output is this: anexoPdfGuia: {} guiaFiscal: "{"empresas_id":"40","tributo_id":4,"mes_referencia":4,"vencime...
asked by 11.05.2018 / 14:55
1
answer

Error executing script in python in Laravel controller

Currently my scripts work perfectly within the schedule that run at specific times within my server's cron. The problem is occurring when I try to execute the method inside the controller, this method basically uses a shell_exec () that e...
asked by 29.06.2018 / 22:36
2
answers

When trying to set column to Unique, error is generated speaking 767 bytes [duplicate]

When I try to run a migration in Laravel, the following error is generated:    [Illuminate \ Database \ QueryException] SQLSTATE [HY000]: General   Error: 1709 Index column size too large. The maximum column size is   767 bytes. (SQ L: alte...
asked by 08.12.2017 / 18:33
2
answers

Select specific columns of two related tables

I have a relation of N x 1, Post x User , have a relationship like the following: Post.php (model): .... public function user() { return $this->belongsTo('User'); } .... What I want is to select the id and the user...
asked by 31.10.2017 / 21:55
1
answer

Is it possible to override the with method of Laravel?

In parts of my application I'm using the following redirect : return redirect('/painel/posts') ->with(['error' => 'Ocorreu um erro ao tentar adicionar o post!']); Could it be in App\Http\Controllers\Controller.php...
asked by 10.11.2016 / 13:29
2
answers

How to keep the foreign key constraint using softdelete?

How can I maintain the integrity of my database when I'm using softdelete ? Example: I try to delete a person that is linked to a account with a foreign key , in this is not possible because it violates the foreign key constrain...
asked by 04.11.2016 / 14:40
1
answer

How to identify in the constructor the method that was called?

How do I in the constructor of my controller identify which method was called? I'm using Laravel 5.3 and my controller follows the default resource ( index, show, edit ...).     
asked by 20.12.2016 / 15:23