peretch / facturacion

Sistema de facturación e inventario creado con Laravel 5.6

Home Page:https://facturacion.peretch.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

problem

maveric2001 opened this issue · comments

Hello, I am new to Laravel, I have installed your program, I create a user and when entering, it gives me this error if it can help me, thanks

Trying to get property 'estilo' of non-object (View: C:\laragon\www\facturacion\resources\views\layouts\app.blade.php) (View: C:\laragon\www\facturacion\resources\views\layouts\app.blade.php)

Hi, how do you created the first user?, you need to run this in tinker or in a seeder:

DB::table('preferencias')->insert([
	'usuario_id' => 1,
	'estilo' => 'css/style_blue.css'
]);

Wen I made this project, I didn't develop a view to create Users, or an afterCreate event to create this register in table preferencias, but is needed. I'll fix it, but you can solve it with that code for now.

Thank you for comment.
Regards

Hello, thank you for your answer, as I mentioned, I am very new to this, I do not know where to put this code, could you tell me the route, please, I am using subline 3

Hi, how do you created the first user?, you need to run this in tinker or in a seeder:

DB::table('preferencias')->insert([
	'usuario_id' => 1,
	'estilo' => 'css/style_blue.css'
]);

Wen I made this project, I didn't develop a view to create Users, or an afterCreate event to create this register in table preferencias, but is needed. I'll fix it, but you can solve it with that code for now.

Thank you for comment.
Regards

Hello, thank you for your answer, as I mentioned, I am very new to this, I do not know where to put this code, could you tell me the route, please, I am using subline 3

Of course, the easier way to do this is with tinker. To open Tinker, just write in your console (in your installation directory): php artisan tinker.

This will open a termina where you can write pure PHP, and use all your Laravel projects logic.

Once you are in tinker, first you need to check your user id:
$users = User::all()

This will return in your console a Collection of users, where you will see your user id.

With that id, you should write this:
DB::table('preferencias')->insert(['usuario_id' => 1, 'estilo' => 'css/style_blue.css']);
usuario_id means your user id (this system was developed in spanish).

I hope this will help you. If not, keep asking and we will find a solution.

Regards

I am very grateful to you for your great help, I hope I can ask you some more things and all the changes that are made will be passed on to you that I know you do not need since you created it but to learn little by little.

Thanks,thanks Thanks a lot

una pregunta usted habla español ya que veo que esta el programa en español gracias

Si, soy de Uruguay, podes preguntarme en español sin problema.

El paso que te está faltando es ejecutar php artisan db:seed, este comando se encarga de cargar los datos necesarios para el mínimo funcionamiento del sistema.

Acá acabo de realizar una instalación limpia que podes probar.

http://facturacion.peretch.com/
usuario: dios
contraseña: admin

  1. clone repo
  2. composer install
  3. configurar database en .env (copiar archivo .env.example)
  4. php artisan migrate --seed

Si queres cargar datos de prueba, podes ejecutar

  1. php artisan db:seed --class=DemoSeeder

No no, con repo me refiero a este mismo que estamos discutiendo. Simplemente escribí todos los pasos desde el principio.