Questions tagged as 'laravel'

2
answers

How to do an if / else within a route?

I have a form that has two types of users: administrators and developers and each has its post login page, but even logged in as administrator, I can go to the developers pages. I need to fix this!     
asked by 19.04.2017 / 19:12
1
answer

How to create Scope in Laravel 5.4 with tables linked through belongsToMany

The structure of the table is this: pessoa id - integer nome - string unidade id - integer nome - string pessoa_unidade pessoa_id - integer unidade_id - integer I have the templates: class Pessoa extends Model { pu...
asked by 06.05.2017 / 12:49
0
answers

Exception in Collection.php line 1543:

   Property [type] does not exist on this collection instance. I am doing a project in Laravel (5.4) where it is practically ready, but this error is occurring, because I want the user to click to login, the \home view does not appear...
asked by 07.04.2017 / 20:04
0
answers

Laravel Query Builder returning duplicate values?

I have the following problem, I have a select using leftJoin , plus this is returning duplicate records, the database is not duplicated and when I run leftJoin it works. Follow SQL Tabela processo -----------------------...
asked by 09.04.2017 / 17:02
1
answer

How do I assign a view to an input type like submit?

I want to assign a blade to an input in my code. For example: The view is called 'panel.blade' and I wanted an input in the view 'adm.blade' to return it. Controller class ClientsController extends Controller {     public function showClie...
asked by 28.03.2017 / 16:32
0
answers

Project using Laravel and MySql

Hello, I'm doing a registration project and I'm stuck in a business. I have a table of Users in MySql where I have a column that is called 'State' (default), that is, an administrator can 'activate' or 'disable' any users. In my view, I made the...
asked by 28.03.2017 / 14:22
0
answers

Provide in the view polymorphic relationship data Laravel

I have the Trainer, Modality and Image models using Laravel's Polymorphic Relations link I want to make this data available in the view and for this I did: AppServiceProvider.php: namespace Powerzone\Providers; use Illuminate\Support\...
asked by 01.05.2017 / 19:50
1
answer

How can I make a password update on a user logged in to Laravel 5.2?

I was trying to change the user's password, but it did not work, someone can help me I'm new to Laravel. public function updatePassword() { $user = Auth::user(); $user->password = bcrypt($request['newpassword']); $user->sav...
asked by 01.04.2017 / 05:37
1
answer

Laravel's past variable recognition problem for JavaScript

I'm developing a web application with Laravel and I noticed something strange. When passing a variable from Laravel to the HTML page two different behaviors are happening: When calling the variable in an internal script in HTML it is rec...
asked by 23.03.2017 / 11:53
0
answers

Date Comparison in Laravel?

I have a list of records and in this table I have a field data_limite : $planos = $this->plano->whereIn('id',$planos_id) ->orderBy('created_at','desc') ->get(); print($planos); I...
asked by 22.03.2017 / 21:36