Questions tagged as 'laravel-5'

1
answer

Create / Modify table without deleting data Laravel Migrate

I have a question about laravel regarding the Migrates. I'm using Laravel 5.1 with SQLite database. When I run the command php artisan migrate or php artisan migrate:refresh , usually to add new tables or insert new fields to exi...
asked by 11.11.2016 / 19:45
1
answer

Problems with relationship one to many laravel

I'm trying to create a simple% category of categories and sub categories where a category can have several subcategories but a subcategory can have only one category. In my migration I made my tables as follows: Schema::create('sub_categorias'...
asked by 10.09.2016 / 05:25
1
answer

I can not do Laravel Authentication 5.2

I've been trying to authenticate for some time and I can not, I'm a beginner in the business, who wants to help me know that it's practically saving my life, since I've thought about giving up on it several times. I'm calling a controller met...
asked by 07.06.2016 / 15:42
1
answer

Laravel - Do not log in after registration ...?

How to remove automatic login after registering? I've commented the following line from the RegisterUsers file: public function register(Request $request) { $validator = $this->validator($request->all()); if ($val...
asked by 01.06.2016 / 16:45
2
answers

Write to two different tables using the same View

I'm doing a supplier registration, and I need to record it in one table and its address in another. I use a single view vendors.blade to fill in all the data. How can I separate this data to write them to their respective tables? Suppliers...
asked by 07.09.2015 / 00:22
1
answer

SQL with associated data in Laravel?

I have the following tables listed below Products id product value Validity Queries id user_id Product_Consults id query_id product_id Whenever a user performs a query, the history in the consultas...
asked by 18.08.2018 / 14:42
1
answer

How to return reregistered records between tables in laravel

I have 2 city and state tables I own the parana state and would like to know how to return all cities related to Parana state in a simple way without having to make a loop of repetition Type $estados = App/Estado::all(); $cidades = App/Cida...
asked by 20.11.2018 / 12:18
1
answer

Is there any way to generate migrations based on an existing Laravel database?

When I used Python's Django, I was surprised by the inspectdb command, which is able to generate the models based on an existing database. In Laravel, we have the migrations to be able to work with the database, and I find a clean and...
asked by 06.09.2018 / 15:03
1
answer

Redirect to new page when error 404 occurs using Laravel 5.6

What is the correct way for Laravel 5.6 to redirect another route if it is 404 error? I created the resources / views / errors / folder and the 404.blade.php and it worked fine, but I do not want to display the error, I want it to be redi...
asked by 10.05.2018 / 19:38
1
answer

bank insert with relationship N: M [duplicate]

I need to insert users into my database the MySQL data already with the N:M relationship, but I do not know how to do that. Migrate: Schema::create('usuarios', function (Blueprint $table) { $table->increments('id'...
asked by 08.02.2018 / 15:44