Questions tagged as 'laravel'

1
answer

Defining a middleware for a controller, except a function in Laravel 5

I'm starting to work now with Laravel and realized that defining the routes directly to the controls where I can set the HTTP request type is more feasible for my application. Today I have something like this: routes.php Route::controller...
asked by 07.08.2016 / 00:42
1
answer

Check which of the 'guards' is loggedin

I have a large application 5.2, with multiauthentication, the guards configured in config/auth.php are: ... 'admin' => [ 'driver' => 'session', 'provider' => 'admin', ], 'user' => [ 'driver' => 'session',...
asked by 17.08.2016 / 15:50
1
answer

Failed to register a package created in Laravel 5.1

I'm developing a package for Laravel 5.1 and I've already identified a problem that I could not find the solution for. Displays the following error: FatalErrorException in ProviderRepository.php line 146: Class 'MyNamespace\MyApp\MyAppServi...
asked by 23.06.2015 / 19:53
1
answer

Transform 2 php array into a single array

I have 2 Arrays : "val" => { "0": "2" "1": "4" "2": "6" "3": null "4": null } "p" => { "0": "4" "1": "5" "2": "7" "3": "8" "4": "9" } So I want to get the elements of array val...
asked by 08.11.2018 / 18:04
1
answer

PHP Artisan command does not work

There was a demand at work where I had to get a Laravel 5 project from a client and start changing it. I had some problems at the time of putting it to run, but now it is going, except for the artisan command, which does not work even whe...
asked by 21.01.2016 / 19:03
1
answer

Undefined offset 0 - Laravel

I have a list of users, each user has their 'role' (role / function inside the system, such as 'user' and 'admin') and this role has to be shown in the users list screen, which I I did it using the code block below. @foreach ($users as $key =&...
asked by 20.09.2018 / 20:40
1
answer

Redirect failure Laravel

Expensive, Can you help me with this laravel redirect? I created a method where it re-evaluates the data and redirects, on the other hand at the time of redirect I get the error Route [climate.consensus.visual.ID] not defined, only that I def...
asked by 11.09.2018 / 19:35
1
answer

Put error message in the view Laravel 5.6

Good evening guys. I am having difficulty returning a friendly error message to the user if he tries to register an employee with an email that is already saved in the database, since in my table this attribute was "set" as unique Can anyone...
asked by 09.09.2018 / 23:39
2
answers

Regex in CPF with Laravel

The system I'm servicing has CPFs registered in two ways, with and without punctuation, due to poor start-up that did not impose a standard. The problem is that the CPF can not be repeated, and when the user types a CPF with no punctuation, if i...
asked by 03.03.2017 / 15:31
1
answer

Laravel - Validate field unique in update

I have an enrollment field in the table that needs to be unique NA MIGRATION Schema::create('professors', function (Blueprint $table) { $table->increments('id'); $table->boolean('inativo')->default(0); $tabl...
asked by 10.05.2018 / 16:17