Posts by Marcos da Cruz Sibilio Jr. • 158 points
10 posts
-
3
votes1
answer508
viewsQ: PHP ternary operator gives unexpected result
Recently I did a test and there was a question asking what the return of expression: $var = true ? '1' : false ? '2' : '3' I replied that the result would be '1', but the correct result is '2'. If…
-
0
votes3
answers381
viewsA: How to use Raspberry as a super user?
In Raspberry, when the installation is done, a password is registered only for the user who uses super user commands through sudo. To use Raspberry as a super user you need to register the password:…
-
1
votes2
answers1965
viewsA: Laravel php auth system
Route::post('/login',['uses'=>'loginController@checkLogin','as' => 'VerificarLogin'])->middleware('auth'); Missed you telling Laravel that it is for that route to be protected by calling…
-
3
votes4
answers1768
viewsA: How to generate a serial key that contains a prefix in the first 5 characters?
Separate into two functions as in the code below: function prefixo(){ $chars =…
phpanswered Marcos da Cruz Sibilio Jr. 158 -
1
votes3
answers781
viewsQ: Problem with CORS using Ionic and Lumen
I’m developing an app with Ionic and using Lumen in the backend API. I am having problems with 'CORS', already configured the server (both using the internal PHP server and Apache, and the same…
-
0
votes2
answers33
viewsA: Replace starting at x and ending at y in php
It is not possible to solve this problem with just one step. Below I created a code that solves your problem. $str1 = "<a title='Link 01' href='http://www.meusite.com.br/?id=121451781'>Link…
phpanswered Marcos da Cruz Sibilio Jr. 158 -
0
votes1
answer59
viewsA: update in the Standard
Modify the code as below: public function update(Request $r, Voluntarios $vol) { $up = $vol->fill($r->all()); $vol->save(); var_dump($up); }…
-
0
votes1
answer466
viewsA: Creating routes for paging
In the code you have inside the ajax call of Jquery there may be error on this line: itemHTML += "<table id='datatable-checkbox' class='table table-striped table-bordered bulk_action dataTable…
-
1
votes1
answer191
viewsA: PHP Unit, run database test, mock test and SQL Lite test all together
You can try using the method setUp() to set up the environment necessary for carrying out the tests and the method tearDown() to return the environment to what it was before you started testing. You…
-
1
votes1
answer902
viewsA: I can’t connect the vuejs in the Laravel
Good morning! Laravel already brings by default an implementation of Vuejs already configured to work, the easiest way to make Vue work is to use this implementation. If you check in…