Posts by geekcom • 328 points
15 posts
-
0
votes1
answer96
views -
0
votes2
answers719
viewsA: How to keep foreign key restriction using softdelete?
I will summarize the solution I adopted in a few steps: 1. Trying to force physical delete (definitive), as there is foreign key restriction in the database the method executes a rollback in the…
-
4
votes2
answers719
viewsQ: How to keep foreign key restriction using softdelete?
How can I maintain the integrity of my database when using softdelete? Example: try to exclude a person which is linked to a account through a foreign key, in normal ways this will not be possible…
-
6
votes1
answer878
viewsQ: Customized authentication with CPF and E-MAIL
I’m thinking of a way to authenticate users using the email and the CPF of the same, so far not found a way to do, someone has a suggestion? public function auth(Request $request) { $credenciais =…
-
5
votes2
answers265
viewsQ: Foreign Key between different databases
Is it possible to link two different databases in a Migration? I am using Postgres. What do I have: $table->integer('id_cliente_produto')->unsigned();…
-
-1
votes2
answers3109
viewsA: Methodnotallowedhttpexception in Routecollection.php - Laravel 5.2
Another alternative would be you use the helper action, below this your changed code. Instead: <input type="hidden" name="_token" value="{{ csrf_token() }}"> Do it: {{ csrf_field() }} And…
-
1
votes2
answers1269
viewsA: How can I treat Violation Constraint exception to show the user in a user friendly way
Another solution would be you use Queryexception, first you need to "call" the class in your controller: use Illuminate\Database\QueryException; Then you can use it as follows: try { $dados =…
-
-3
votes3
answers1022
viewsA: How to keep a radio input selected in a view in Laravel?
The general solution was as follows. View: <div class="col-md-3"> <div class="form-group"> <label>Tipo de Conta</label> <p><input type="radio" name="tipo" value="CC"…
-
0
votes3
answers1022
viewsQ: How to keep a radio input selected in a view in Laravel?
How would you keep one radio input selected in my view, I have the following codes: View: <div class="col-md-3"> <div class="form-group"> <label>Tipo de Conta</label>…
-
1
votes1
answer598
viewsA: Best Practice for Mass Assignment
It is not necessary to write as much, do the following with your add method: public function adiciona(Request $request){ //capturar todos os dados do form $dadosFormulario = $request->all();…
-
1
votes3
answers1065
viewsA: Multiplo INSERT Models Laravel 5
I thank everyone who has tried to help me in this matter, I have managed to resolve it in the following way: public function store(Request $request) { //captura dados Model Pessoa $dadosPessoa =…
-
1
votes3
answers1065
viewsQ: Multiplo INSERT Models Laravel 5
I am developing a system and came across the following situation: I need to enter the data first in the 'person' table, retrieve the last 'id_person' and then insert the data in the 'provider' table…
-
0
votes3
answers1454
viewsQ: Access all file settings. env
Does anyone know how to access all the data that is in the file . env? , I need to bring all the data as an array, I have already used the helper env() function, without success, I need something…
-
1
votes2
answers1244
viewsA: How to work with scripts and style sheets in Laravel 5.1
Help a little more do so: <link href="{!! asset('css/aqr.css') !!}" media="all" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="{!! asset('js/aqr.js')…
-
1
votes1
answer49
viewsA: Create Schema with Laravel 5.1
It’ll be something like: DB::getConnection()->statement('CREATE DATABASE :schema', ['schema' => $schemaName]);