daniel21gt

daniel21gt

Member Since 10 Months Ago

Experience Points 4,750
Experience Level 1

250 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 0
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

04 Aug
2 weeks ago

daniel21gt started a new conversation Problem With Installation Of Laravel 5.5 Project

I have installed the version of php 7.1.3 in linux, and when I try to install a project via composer, it gets me this error.

  [[email protected] www]# composer create-project laravel/laravel prueba 5.5.*
  Installing laravel/laravel (v5.5.28)
  - Installing laravel/laravel (v5.5.28): Loading from cache
 Created project in prueba
 > @php -r "file_exists('.env') || copy('.env.example', '.env');"
 Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

   Problem 1
    - laravel/framework v5.5.9 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
  from your system.
      - laravel/framework v5.5.8 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
  from your system.
       - laravel/framework v5.5.7 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
  from your system.
       - laravel/framework v5.5.6 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
  from your system.
      - laravel/framework v5.5.5 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
  from your system.
      - laravel/framework v5.5.46 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
  from your system.
      - laravel/framework v5.5.45 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
  from your system.
      - laravel/framework v5.5.44 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
  from your system.
      - laravel/framework v5.5.43 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
      - laravel/framework v5.5.42 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
      - laravel/framework v5.5.41 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
     - laravel/framework v5.5.40 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
    - laravel/framework v5.5.4 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
     - laravel/framework v5.5.39 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
     - laravel/framework v5.5.38 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
     - laravel/framework v5.5.37 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
     - laravel/framework v5.5.36 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
     - laravel/framework v5.5.35 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
from your system.
     - laravel/framework v5.5.34 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
from your system.
     - laravel/framework v5.5.33 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
     - laravel/framework v5.5.32 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
     - laravel/framework v5.5.31 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
     - laravel/framework v5.5.30 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
     - laravel/framework v5.5.3 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
     - laravel/framework v5.5.29 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
    - laravel/framework v5.5.28 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
     - laravel/framework v5.5.27 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
    - laravel/framework v5.5.26 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
    - laravel/framework v5.5.25 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
    - laravel/framework v5.5.24 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
    - laravel/framework v5.5.23 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
    - laravel/framework v5.5.22 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
     - laravel/framework v5.5.21 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
      - laravel/framework v5.5.20 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
      - laravel/framework v5.5.2 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
     - laravel/framework v5.5.19 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
     - laravel/framework v5.5.18 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
     - laravel/framework v5.5.17 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
      - laravel/framework v5.5.16 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
      - laravel/framework v5.5.15 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
     - laravel/framework v5.5.14 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
     - laravel/framework v5.5.13 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
     - laravel/framework v5.5.12 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
 from your system.
    - laravel/framework v5.5.11 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
from your system.
   - laravel/framework v5.5.10 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
from your system.
     - laravel/framework v5.5.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
from your system.
    - laravel/framework v5.5.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing 
from your system.
     - Installation request for laravel/framework 5.5.* -> satisfiable by laravel/framework[v5.5.0, v5.5.1, 
  v5.5.10, v5.5.11, v5.5.12, v5.5.13, v5.5.14, v5.5.15, v5.5.16, v5.5.17, v5.5.18, v5.5.19, v5.5.2, v5.5.20, v5.5.21, 
  v5.5.22, v5.5.23, v5.5.24, v5.5.25, v5.5.26, v5.5.27, v5.5.28, v5.5.29, v5.5.3, v5.5.30, v5.5.31, v5.5.32, v5.5.33, 
  v5.5.34, v5.5.35, v5.5.36, v5.5.37, v5.5.38, v5.5.39, v5.5.4, v5.5.40, v5.5.41, v5.5.42, v5.5.43, v5.5.44, v5.5.45, 
  v5.5.46, v5.5.5, v5.5.6, v5.5.7, v5.5.8, v5.5.9].

   To enable extensions, verify that they are enabled in your .ini files:
     - /etc/php.ini
     - /etc/php.d/10-opcache.ini
     - /etc/php.d/20-bz2.ini
     - /etc/php.d/20-calendar.ini
    - /etc/php.d/20-ctype.ini
    - /etc/php.d/20-curl.ini
    - /etc/php.d/20-exif.ini
    - /etc/php.d/20-fileinfo.ini
    - /etc/php.d/20-ftp.ini
    - /etc/php.d/20-gd.ini
    - /etc/php.d/20-gettext.ini
    - /etc/php.d/20-iconv.ini
    - /etc/php.d/20-json.ini
    - /etc/php.d/20-mcrypt.ini
    - /etc/php.d/20-mysqlnd.ini
    - /etc/php.d/20-pdo.ini
    - /etc/php.d/20-phar.ini
    - /etc/php.d/20-sockets.ini
     - /etc/php.d/20-sqlite3.ini
    - /etc/php.d/20-tokenizer.ini
    - /etc/php.d/30-mysqli.ini
    - /etc/php.d/30-pdo_mysql.ini
    - /etc/php.d/30-pdo_sqlite.ini
    You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode
31 Jul
3 weeks ago

daniel21gt left a reply on Problems With Layouts.layout, Laravel 5.5

Thank snapey, I checked and was missing a Layouts folder with an .html called layout

daniel21gt started a new conversation Problems With Layouts.layout, Laravel 5.5

How about, I have a problem in one of my views, since at the beginning I have this variable

       @extends('layouts.layout')

but i have this error

       View [pages.layouts.layout] not found. (View: C:\laragon\www\usuarios\resources\views\usuarios\index.blade.php)"

Why is this happening to me?

06 Jul
1 month ago

daniel21gt left a reply on Problems To Modify Table Attribute In Migrations, Laravel 5.5

Thank you very much, I do not erase data, now I understand

daniel21gt left a reply on Problems To Modify Table Attribute In Migrations, Laravel 5.5

Suppose I make the change in the migration, but I do not understand how to execute that migration, without deleting the data that I already have in the users table

daniel21gt started a new conversation Problems To Modify Table Attribute In Migrations, Laravel 5.5

How are you.

I know that to alter changes in existing migrations, this command can be applied.

php artisan make: migration users

But in my case, I have a table users with a field called mail, which has an attribute like UNIQUE (), how can I change this attribute, without altering the information I have in the tables?

01 Jul
1 month ago

daniel21gt left a reply on Consultation Construction Query Builder, Laravel 5.5

Thanks Snapey for your time, run the lines, this error appears.

"Object of class stdClass could not be converted to string"

Should I pass the array of objects to string?

daniel21gt left a reply on Consultation Construction Query Builder, Laravel 5.5

Exact, subquery returns an array of usuarios names AND 'Thor', I will try to fix it.

daniel21gt left a reply on Consultation Construction Query Builder, Laravel 5.5

The last mistake I mentioned, points to this line, $this->addBinding($query->getBindings(), 'union');

public function union($query, $all = false)

{

    if ($query instanceof Closure) {

        call_user_func($query, $query = $this->newQuery());
    }

    $this->unions[] = compact('query', 'all');

    $this->addBinding($query->getBindings(), 'union');

    return $this;
}

daniel21gt left a reply on Consultation Construction Query Builder, Laravel 5.5

If snapey, are two tables, apologize for ambiguity, the users table is a table for users with role, while the usuarios table is for users without a role. whereIn is to consult from the usuarios table, all people that are directly related to 'thor', in table users.

This is the original query in sql that works for me.

select usuario_ad, count(usuario_ad) from usuarios where usuario_ad in (select username from users where users.refer="Thor" union select "Thor") group by (usuario_ad);

daniel21gt left a reply on Consultation Construction Query Builder, Laravel 5.5

Thank you very much, that mistake does not come out, now I get this one.

"Call to a member function getBindings() on string"

daniel21gt started a new conversation Consultation Construction Query Builder, Laravel 5.5

What's up friends.

Well, I'm building a query to query builder, I managed to structure it but I have an error that I do not know how to solve.

$data = DB::table('usuarios')

           ->selectRaw('usuario_ad', 'count(usuario_ad) as Conteo')
           ->whereIn('usuario_ad', function($query){
                        $query->select('username')
                         ->from('users')
                         ->where('users.refer', 'Thor')
                         ->union('Thor');
                   })->groupBy('usuario_ad')->paginate(20);

the error.

"Type error: Argument 2 passed to Illuminate\Database\Query\Builder::selectRaw() must be of the type array, string given, called in C:\laragon\www\arreglo\app\Http\Controllers\CuentaController.php on line 46 "

daniel21gt left a reply on Combining Two Consultations With Eloquen Laravel 5.5

Thank you very much snapey, the solution was with orWhere

30 Jun
1 month ago

daniel21gt started a new conversation Problem With Translation Of Query To Eloquent, Laravel 5.5

What a companion.

I have tried to convert this sql query to eloquen, but I have messed it up when joining another query.

select usuario_ad, count(usuario_ad) from usuarios where usuario_ad in (select username from users where users.refer="Thor" union select "Thor") group by (usuario_ad);

in eloquen

$uno = User::where('refer', 'thor')->select('username')->union('thor'); Usuarios::select('usuario_ad')->count('usuario_ad')->whereIn('usuario_ad', $uno)->groupby(usuario_ad);

They are two different tables, one called usuarios and other users.

29 Jun
1 month ago

daniel21gt left a reply on Problem With Double Consultation Eloquen In Laravel

User::where("refer", "thor")->orwhere("username", "thor")->paginate(10);

28 Jun
1 month ago

daniel21gt started a new conversation Problem With Double Consultation Eloquen In Laravel

That such. I have tried this consultation in Tinker, and it works very well

User::where("refer", "thor")->union(User::where("username", "thor"))->get();

but when I use it in the driver, an error appears

$user=User::where("refer", "thor")->union(User::where("username", "thor"))->paginate(10); $conteo=User::where("name", $filtro)->count(); return view('Usuario.ecuenta')->with(["user" => $user, "conteo" => $conteo]);

SQLSTATE[21000]: Cardinality violation: 1222 The used SELECT statements have a different number of columns (SQL: (select count(*) as aggregate from users where refer = thor) union (select * from users where username = thor))

Because of this mistake?

daniel21gt started a new conversation Combining Two Consultations With Eloquen Laravel 5.5

Such. I have tried to unite these two consultations without success in one, I need to put a Union, someone knows how to do with this equema?

$consul=user::where("refer",$filtro);

$user=user::where("username", $filtro)->join('tipos_usuarios', 'users.tipos_usuarios_id', '=' , 'tipos_usuarios.idc')->paginate(1);

25 Jun
1 month ago

daniel21gt left a reply on Problems With Translation Eloquent, Laravel 5.5

thanks aurawindsurfing.... There are two tables, one call Usuarios and the other called Users

daniel21gt started a new conversation Problems With Translation Eloquent, Laravel 5.5

What's up friends.

I have tried to transcribe this query to eloquen, but it has been difficult for me to do it, does anyone know how I can fix it?

select usuario_ad, nombre from usuarios where usuario_ad in (select username from users where users.refer="angelicaad" union select "angelicaad" );

18 Jun
2 months ago

daniel21gt started a new conversation Problem Order Select, Laravel 5.5

How I have the following code

public function create(Request $request) { $registrado = \Auth::user()->tipos_usuarios_id;

      if($registrado == 1)
      {
         $request->user()->authorizeRoles(['admin']);
         $governor = \DB::table('governor')->select('idg', 'governor_candidate')->get();
         $mayor = \DB::table('mayor')->select('idm', 'mayor_candidate')->get();
         $advice = \DB::table('advice')->select('ida', 'advice_candidate')->orderBy('advice_candidate','asc')->get();
         $assembly = \DB::table('assembly')->select('idas', 'assembly_candidate')->get();
         return view('Usuario.create')->with(['governor' => $governor, 'mayor' => $mayor, 'advice' => $advice, 'assembly' => $assembly]);
      }

}

This brings me these values, about the consultation advice

Anderson carlos jhon Jorge Otro Robert

What can I do to make the word Otro, last and not penultimate

In the database if it appears in the same order in which you create them, but when I consult

02 Jun
2 months ago

daniel21gt left a reply on Problem With Nginx Configuration, Laravel 5.5

When I charge the server ip, it shows me the nginx index instead of the laravel page, will this be the problem?

daniel21gt left a reply on Problem With Nginx Configuration, Laravel 5.5

Thank you very much, you are right, you must open with / login, but even so the nginx says it can not find the page.

daniel21gt started a new conversation Problem With Nginx Configuration, Laravel 5.5

How about, I'm setting laravel on a centos server, I have finished but nginx does not load the project, I have this configuration.

server {

listen 80;

server_name (nombre_dominio.com);

root /var/www/html/votaciones/public;

index index.php;

charset utf-8;

gzip on;

gzip_types text/css application/javascript text/javascript application/x-javascript image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;

location / {

try_files $uri $uri/ /index.php?$query_string;

} location ~ .php {

include fastcgi.conf;

fastcgi_split_path_info ^(.+.php)(/.+)$;

fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; } location ~ /.ht { deny all; } }

which believes in

nano /etc/nginx/conf.d/testsite.conf

But I get this error, open url http://192.168.0.107/votaciones/public/login

The page you are looking for is not found.

and in the logs.

2019/06/03 00:30:58 [error] 4217#0: *3 open() "/usr/share/nginx/html/votaciones/public/login" failed (2: No such file or directory), client: 192.168.0.122, server: _, request: "GET /votaciones/public/login HTTP/1.1", host: "192.168.0.107

I do not understand what I may be missing

my route

Route::get('/', function () { return view('auth/login'); });

Route::get('/panel', '[email protected]'); Route::post('/panel/filtusuario', '[email protected]')->name('usuario.filtusuario'); Route::post('/panel/gestion', '[email protected]')->name('usuario.ugestion'); Route::get('/panel/bestado', '[email protected]')->name('usuario.bestado'); Route::get('/panel/selectord', '[email protected]')->name('usuario.selectord'); Route::get('/panel/revisar', '[email protected]')->name('cuenta.revisar'); Route::post('/panel/estado', '[email protected]')->name('cuenta.cestado'); Route::post('/panel/asignar', '[email protected]')->name('cuenta.asignar'); Route::get('/panel/tareas', '[email protected]')->name('cuenta.tareas'); Route::get('/panel/inactivo', '[email protected]')->name('cuenta.inactivo'); Route::get('/panel/reportes', '[email protected]')->name('cuenta.reportes'); Route::get('/panel/governor', '[email protected]')->name('usuario.governor'); Route::get('/panel/mayor', '[email protected]')->name('usuario.mayor'); Route::get('/panel/advice', '[email protected]')->name('usuario.advice'); Route::get('/panel/assembly', '[email protected]')->name('usuario.assembly'); Route::get('panel/descarga', '[email protected]')->name('products.excel'); Route::get('panel/excelestados', '[email protected]')->name('products.excelestados'); Route::get('panel/excelestadostres', '[email protected]')->name('products.excelestadostres'); Route::get('panel/excelestadoscuatro', '[email protected]')->name('products.excelestadoscuatro'); Route::resource('/panel/ecuentas', 'CuentaController')->except(['show']); Route::resource('/panel/registros', 'RegistrosController'); Route::get('/panel/fecha', '[email protected]')->name('usuario.fecha'); Route::get('/panel/selector', '[email protected]')->name('usuario.selector'); Route::post('/panel/cedula', '[email protected]')->name('usuario.cedula'); Route::get('panel/excelgobernadores', '[email protected]')->name('products.excelgobernadores'); Route::get('panel/excelalcaldes', '[email protected]')->name('products.excelalcaldes'); Route::get('panel/excelconsejales', '[email protected]')->name('products.excelconsejales'); Route::get('panel/excelasamblea', '[email protected]')->name('products.excelasamblea'); Route::resource('/panel/usuario', 'UsuarioController')->except(['show']); Auth::routes();

31 May
2 months ago

daniel21gt started a new conversation Server Installation For Laravel 5.5 Project

How are you.

My concern is that I have a project in laravel, which will be used in the company where I work, and my intention is to install my project already finished in larvel, on a linux server, someone knows or knows about some documentation, about how I can prepare a linux to work for laravel page?

19 May
3 months ago

daniel21gt left a reply on Problems With Excel Function. Larvel 5.5

because if I did so $ request-> governore, it brings me a NULL value, so I had to bring the values, separating them from the url, so it works well, the thing is that, I do not know why it works if they download well with the filters that you consult, but in mozilla and google chrome no.

18 May
3 months ago

daniel21gt left a reply on Problems With Excel Function. Larvel 5.5

Maybe my configuration of htacces will have to see?

Options +FollowSymLinks

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^ index.php [L]

daniel21gt started a new conversation Problems With Excel Function. Larvel 5.5

How about, I have an excel function, which when sending any filter like for example, result1 or result2, this generates an excel with one of those two variables, this works very well in browser opera, but does not work in google chrome or mozilla , since these two are left with the first excel that I download, that is, if I filter with another variable, it still downloads the first excel that it downloads, does anyone know what this is?

public function excelgobernadores(Request $request) {

   $registrado = \Auth::user()->tipos_usuarios_id;
   $filtros = \Auth::user()->username;
   

   if($registrado == 1)

    {

      $request->user()->authorizeRoles(['admin']);

    
        $urlgover = request()->headers->get('referer');
         parse_str(parse_url($urlgover)['query'], $output);
          $valorgober = $output['governore'];


        Excel::create('ExcelGobernadores', function($excelgobernadores) use ($valorgober){
            $excelgobernadores->sheet('Excelsheet', function($sheet) use ($valorgober){
    
              $conteogobe = usuarios::join('governor', 'usuarios.gobe_id', '=' , 'governor.idg')->where('gobe_id',$valorgober)->where('asignacion', '<>', '')->select('user_id', 'user_id', 'usuario_ad', 'nombre', 'apellido', 'cedula', 'telefonos', 'direccion', 'barrio', 'lugar_votacion', 'mesa_votacion', 'email', 'ciudad', 'comentario', 'asignacion', 'estado', 'governor.governor_candidate')->get();
              $conteogobe = json_decode( json_encode($conteogobe), true);
              $sheet->fromArray($conteogobe);
              $sheet->setOrientation('landscape');

           });

        })->export('xls');
    
   }

daniel21gt left a reply on Problems With Excel Hosting Reports. Laravel 5.5

It is as if the browser cache is pasted in the first excel report, and will stay there without generating something different, Maybe I should do something to make the excel function work in google chrome

daniel21gt started a new conversation Problems With Excel Hosting Reports. Laravel 5.5

How about, I have scheduled these reports that work very well locally,

this is, in that when I do a query for a different filter, I click on the button to download excel report, and this download what I have consulted without problems, but now that I upload everything to a hosting, it does not work anymore, because if I consult with different filters, whenever I download the excel I get the first result that I consult and not the following ones that I consult.

the strangest thing is that it only happens with google chrome, and not in other browsers, why did this happen?, Should I enable something in the hosting to avoid this behavior?

       <td style="width:20%;" border="0"> 
        
         @if(Auth::user()->hasRole('admin'))  
          <table style="width:100%;" border="0" >
             <tr><td style="width:50%;" border="0">           
                  <a href="{{ route('products.excelgobernadores') }}" class="btn btn-sm btn-primary">
                     Descargar reporte en Excel
                  </a>
             <td style="width:25%;" border="0"> 
        </table>
        @endif
        @if(Auth::user()->hasRole('gestion'))  
          <table style="width:100%;" border="0" >
             <tr><td style="width:50%;" border="0">           
                  <a href="{{ route('products.excelgobernadores') }}" class="btn btn-sm btn-primary">
                     Descargar reporte en Excel
                  </a>
             <td style="width:25%;" border="0"> 
        </table>
        @endif

Metod

if($registrado == 1)

    {

      $request->user()->authorizeRoles(['admin']);


        $urlgover = request()->headers->get('referer');
         parse_str(parse_url($urlgover)['query'], $output);
          $valorgober = $output['governore'];


        Excel::create('ExcelGobernadores', function($excelgobernadores) use ($valorgober){
            $excelgobernadores->sheet('Excelsheet', function($sheet) use ($valorgober){
    
              $conteogobe = usuarios::join('governor', 'usuarios.gobe_id', '=' , 'governor.idg')->where('gobe_id',$valorgober)->where('asignacion', '<>', '')->select('user_id', 'user_id', 'usuario_ad', 'nombre', 'apellido', 'cedula', 'telefonos', 'direccion', 'barrio', 'lugar_votacion', 'mesa_votacion', 'email', 'ciudad', 'comentario', 'asignacion', 'estado', 'governor.governor_candidate')->get();
              $conteogobe = json_decode( json_encode($conteogobe), true);
              $sheet->fromArray($conteogobe);
              $sheet->setOrientation('landscape');

           });

        })->export('xls');
    
   }
09 May
3 months ago

daniel21gt left a reply on Problem When Running Seeders Laravel 5.5

I've applied it, but I'm still the same.

daniel21gt started a new conversation Problem When Running Seeders Laravel 5.5

I am currently migrating my project to a real hosting, so far everything is fine, the migrations were executed without problems, but at the time of executing the seeder I see this error.

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'winnersc_asambles2019.Mayor' doesn't exist (SQL: insert into Mayor (mayor_candidate, updated_at, created_at) values (AlcaldeUno, 2019-05-10 01:27:21, 2019-0 5-10 01:27:21))

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'winnersc_asambles2019.Mayor' doesn't exist

I do not understand why, the table does exist, the migrations were correct, when I run them on my local server it goes without problems but in the hosting, no one knows why this?

my seeder

08 May
3 months ago

daniel21gt started a new conversation Problems When Applying Migrations In Hosting With Laravel 5.5

I get this error, when trying to apply a migration, in a hosting.

in connection.php driver (SQL: select * from information_schema.tables where table_schema = winnersc_bdd and table_name=migrations)

in connector.php line 67: could not find driver.

It's the first time that I have put my project on a real hosting, and I do not know what I should do to fix that problem.

daniel21gt started a new conversation Doubt With Installation Of Project In Hosting

My question is the following, if I contract a hosting that supports laravel, this should already have the composer already installed, or should it be installed?

How can I realize that my hosting service really supports laravel 5.5 from linux console by ssh connection?

17 Mar
5 months ago

daniel21gt started a new conversation Problem With Infinite Scroll Select, In Laravel 5.5

How about, I have tried to make an infinite select with scroll, since currently the select that I have loads indefinitely many records, but in the end it will be uncomfortable to see such a large list, which is why I want a scroll in the select that loads everything what's in that field of the bd, this is what I have.

<table style="width:100%;" border="0">
    <tr>
        <td style="width:100%;" border="0">

            <select name="tipo" id="tipo" class=" form-control" value="{{ old('tipo') }}" required style="width:150px">
                @foreach($usuariosOpciones as $user_id => $usuario_ad)
                <option value="{{$user_id}}">{{ $usuario_ad }}</option>
                @endforeach
            </select>
        </td>

        <td style="width:50%;" border="1">
            <button type="submit" class="btn btn-primary">enviar</button>
        </td>
    </tr>
</table>

This is my controller.

public function selector(Request $request)

    {   

        $registrado = \Auth::user()->tipos_usuarios_id;
        $filtro = \Auth::user()->username;
        $filid = \Auth::user()->id;

      if($registrado == 1)

      {
        $request->user()->authorizeRoles(['admin']);
        $usuarios=usuarios::where("user_id", $request->tipo)->paginate(10);
        $usuarios->appends(['tipo'=> $request->tipo]);
        $usuariosOpciones=usuarios::pluck('usuario_ad', 'user_id')->unique();
        $conteo=usuarios::where('user_id', $request->tipo)->count();
        return view('usuario.index')->with(["usuarios" => $usuarios, "usuariosOpciones" => $usuariosOpciones, "conteo" => $conteo]);
       }

}

I know there are several ways to do it with ajax or jquery for example, but I'm new to these languages, I still do not understand the logic to implement it in what I have, and thus achieve a simple scroll select.

07 Mar
5 months ago

daniel21gt started a new conversation Problem With Query Insert Into, Laravel 5.5

I have the following code.

{

$this->validate($request,['user_id', 'gobe_id'=>'required', 'alcal_id'=>'required', 'conse_id'=>'required', 'asam_id'=>'required', 'nombre'=>'required', 'apellido'=>'required', 'cedula'=>'required|max:11|unique:usuarios', 'telefonos'=>'required','direccion'=>'required', 'barrio'=>'required', 'lugar_votacion'=>'required', 'mesa_votacion'=>'required', 'email'=>'required|unique:usuarios', 'ciudad'=>'required', 'estado']);

              usuarios::create($request->all());

}

When I enter this ID number 4521511210

I get this error

"SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'cedula' at row 1 (SQL: insert into usuarios (user_id, usuario_ad, nombre, apellido, telefonos, cedula, barrio, lugar_votacion, mesa_votacion, email, ciudad, direccion, gobe_id, alcal_id, conse_id, asam_id, updated_at, created_at) values (3, danielad, velentina, sarmiento, 5142621, 4521511210, cuba, cuba, 32, [email protected], Dosquebradas, cra 12 45 65, 3, 3, 1, 1, 2019-03-08 02:30:44, 2019-03-08 02:30:44))

05 Mar
5 months ago

daniel21gt left a reply on What Are The Ways To Compare NULL Values? In Laravel 5.5

I understand cronix, I just thought maybe there could be another way, but if you say that's fine, then I can rest assured, thank you for your opinion.

daniel21gt started a new conversation What Are The Ways To Compare NULL Values? In Laravel 5.5

How about, I have the following query comparing a NULL value, I do not think it is the most appropriate way, is there a more technical way to compare a null column?

usuarios::where('asignacion', NULL)->where('cedula', $request->cedula)->update(['asignacion' => $gestionUnicos->last()]);

02 Mar
5 months ago

daniel21gt left a reply on Doubt With Implementation Of Dynamic Select In Laravel 5.5

No, dependent, no, I just need a select but infinite

daniel21gt started a new conversation Doubt With Implementation Of Dynamic Select In Laravel 5.5

Can someone advise me, where can I investigate to create an infinite and dynamic select?

24 Feb
5 months ago

daniel21gt left a reply on Configuring Redirection In Laravel 5.5

Thanks jlrdw, that's a very recursive idea, it will do

daniel21gt left a reply on Configuring Redirection In Laravel 5.5

Is there any file that you can see 419.blade.php, to redirect it to login?

daniel21gt started a new conversation Configuring Redirection In Laravel 5.5

so, today I tried to perform a redirect, I pretend that when the session time expires, I automatically redirected to the login path, and not to this path (\ vendor \ laravel \ framework \ src \ Illuminate \ Foundation \ Exceptions \ views \ 419.blade.php

I have done this in the handler, but it does not work, it keeps getting there.

* @param  \Exception  $exception
 * @return void
 */
public function report(Exception $exception)
{
    parent::report($exception);
}

/**
 * Render an exception into an HTTP response.
 *
 * @param  \Illuminate\Http\Request  $request
 * @param  \Exception  $exception
 * @return \Illuminate\Http\Response
 */
public function render($request, Exception $exception)
{
    
      if($this->isHttpException($exception))
    {
        switch ($exception->getStatusCode()) {
            //access denied
            case 401:
                return response()->view('usuario.error', [], 401);  
            break;
            // not found
            case 404:
                return response()->view('usuario.error', [], 404);
            break;
            // internal error
            case 403:
                return response()->view('usuario.error', [], 403);  
            break;
            // internal error
            case 500:
                return response()->view('usuario.error', [], 500);  
            break;
              // internal error
            case 405:
                return redirect()->route('login');
            break;
            // internal error
            case 419:
                return redirect()->route('login');
            break;

            default:
                return $this->renderHttpException($exception);
            break;
        }
    }
    else
    {
        return parent::render($request, $exception);
    }

}

What can I do to achieve this?

14 Feb
6 months ago

daniel21gt started a new conversation Problem When Selecting Laravel 5.5 Columns

How about, I have the following query, in eloquen.

$conteoconsejales = usuarios::join('advice', 'usuarios.conse_id', '=' , 'advice.ida')->where('conse_id',$valorconse)->where('asignacion', '<>', '')->select('user_id', 'usuario_ad')->get();

The problem is that I have a column from another table, called advice, but I want to include it within the -> select (), but I do not know if this can be done?

01 Feb
6 months ago

daniel21gt left a reply on Problems With Select When Sending Data By POST. Laravel 5.5

I found the error, it was necessary to add the id field in the query.

$governor=governor::select('id','governor_candidate')->orderByRaw("FIELD(id, $gobernadorf) DESC")->get();

daniel21gt started a new conversation Problems With Select When Sending Data By POST. Laravel 5.5

I have the following html code, my problem is that in the end I have 4 select, which work well, I extract correct information.

https://paste.laravel.io/01a2ce91-4dc2-4160-b746-b6af50cd42b9

The problem is when I send this by POST to the update driver, since I have this error.

"SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'gobe_id' cannot be null (SQL: update usuarios set gobe_id = , alcal_id = , conse_id = , `a ▶"

I do not understand why, in actuality, the select ones have records, but when sending them, they do not send anything, why could this happen?

the select well extract the information, come from this method.

public function edit(Request $request, $id) {

      $registrado = \Auth::user()->tipos_usuarios_id;

      if($registrado == 1)
         {

           $request->user()->authorizeRoles(['admin']);
           $comprobarr=usuarios::where('id', $id)->get();
              if ($comprobarr->isNotEmpty())
                   {

                        $usuarios=usuarios::find($id);
                        $gobernadorf=($usuarios->gobe_id);
                        $alcaldef=($usuarios->alcal_id);
                        $consejof=($usuarios->conse_id);
                        $asambleaf=($usuarios->asam_id);
                        $governor=governor::select('governor_candidate')->orderByRaw("FIELD(id, $gobernadorf) DESC")->get();
                        $mayor=mayor::select('mayor_candidate')->orderByRaw("FIELD(id, $alcaldef) DESC")->get();
                        $advice=advice::select('advice_candidate')->orderByRaw("FIELD(id, $consejof) DESC")->get();
                        $assembly=assembly::select('assembly_candidate')->orderByRaw("FIELD(id, $asambleaf) DESC")->get();
                        return view('usuario.edit')->with(['usuarios' => $usuarios ,'governor' => $governor, 'mayor' => $mayor, 'advice' => $advice, 'assembly' => $assembly]);

                   }
              else
                   {

                       return view('usuario.error');
                   }

          }
31 Jan
6 months ago

daniel21gt left a reply on Problems With Query Translation Sql To Eloquent, Laravel 5.5

Thank very muchs jlrdw, this is the solutions

governor::select('governor_candidate') ->orderByRaw("FIELD(id, 3) DESC") ->get();