Questions tagged as 'laravel'

2
answers

Date being recorded wrong in bank m-d-Y instead of Y-m-d

I set the date format for viewing to "d-m-Y", while the recording format is the "Y-m-d" bank. However at the time of recording in the bank, something happens and the data is going in the format "mdY", and with that the data will be truncated,...
asked by 22.12.2013 / 23:37
3
answers

Route access control - Laravel 5.1

I have some views that only clients can access, and some that only administrators can access. What I defined in the case is the client_id, which if "1" is an administrator and if it is any other client. I control this with 2 Middleware locally,...
asked by 27.01.2016 / 15:31
2
answers

Join in Laravel 5.x in two tables?

I have two tables that are already related in MySQL and I use Laravel , I'm already persisting the information in the database. When I write a story, it is already assigned to the author (tables autor and news ). At...
asked by 03.05.2017 / 21:36
1
answer

Many relationship to many laravel

Well, I've tried to read the documentation and develop this relationship, but I can not really tell you what the user's name is. The database model looks like this: % of% involved App\User App\TipoUser App\UserTipo And in my model i...
asked by 04.05.2017 / 01:45
2
answers

Doubt when performing SQL with Eloquent of Laravel

I have a bug that I do not know the reason for it. I have in my controller the following Eloquent : $balances = BankUser::select(DB::raw('SUM(balance) AS total, created_at, DATE(created_at) AS total_at'))...
asked by 12.12.2018 / 16:46
1
answer

Randomly display data from a database

I would like to stop displaying by date and descending and make it display randomly or as I know it - random. Below is the excerpt that I have to modify from the php file: public function getNewReleases() { return Album::with('artis...
asked by 14.09.2017 / 16:30
3
answers

Pass Cursor to the Next Field of the Form

I have a form with several inputs, combos and etc. How can I do that when the user selects an option in the combo the cursor already jumps to the next field of the form? Also make sure that when the user completes a field that has a certai...
asked by 05.02.2016 / 18:05
1
answer

Laravel Auth :: Atempt () always returns false

I tried to authenticate, but always returns false in the Auth::attempt() method of Laravel: $prontuario = Input::get('prontuario'); $senha = Input::get('senhas'); if (Auth::attempt(['prontuario' => $prontuario, 'senha' =>...
asked by 03.11.2016 / 00:50
2
answers

Problem in a foreach

I'm using Laravel 5.3 , and when doing a foreach in the view, it does not recognize as an object, but if I print only what is in the $user variable it prints a json object %. Controller: public function getAll() { retu...
asked by 08.11.2016 / 12:17
2
answers

How do I find out the first or last Loop item in Laravel?

I have the following foreach in Laravel. @foreach($values as $value) <li>{{ $value }}</li> @endforeach I would like to add some special information when it comes to the first item in the loop. In some other template...
asked by 02.09.2016 / 16:57