javineo

Experience

1,080

0 Best Reply Awards

  • Member Since 5 Months Ago
  • 1 Lesson Completed
  • 0 Favorites

29th March, 2018

javineo left a reply on Last Registry Of Table In SQL Server • 2 months ago

@m-rk I found the following solution based on your proposal:

       $lastone= Contacts::select('num_person')
       ->orderby('num_person', 'desc')
       ->first();

Thank you ... Totals

javineo started a new conversation Last Registry Of Table In SQL Server • 2 months ago

I have to perform the following SQL Server query to get the last record of my table. To obtain it I use the following SQL Server select:

SELECT TOP 1 * FROM... ORDER BY RowId DESC

How can I do the same with Eloquent in laravel 5.5?

Thank you . . Totals

1st March, 2018

javineo left a reply on Other Port Other Than 80 And Guzzle Do Not Get Along? • 3 months ago

I already tried postman, eventually it works it eventually fails. For example, I consulted the same API from Postman with port 7744 and it answered correctly, and at the same time that API consulted it from a website and did not answer. I would really like to know if this is a configuration problem of port forwarding or a problem in the Guzzle library.

Thank you!

javineo started a new conversation Other Port Other Than 80 And Guzzle Do Not Get Along? • 3 months ago

I have a server in my local network where I have a webservice made in Laravel that uses Guzzle 6.3. Said webservice is consumed by a web that is outside of my local area network, in a hosting provider. I have a router where I configured an external 7844 port and it is redirected to the internal port 80 of my webservice server. When making requests from the external hosting, the connection is rejected. When I use port 80 or 8080 to connect from the hosting to the webservice. . .then if he walks. Guzzle has a problem with ports other than 80 or 8080? I found something to hear about the Guzzle theme in version 6.3 regarding 5.

Thanks for your attention

javineo left a reply on Guzzle And Problem In Port:80 • 3 months ago

Yes!! Not only can I access a page in that port but I test my API with Postman and answer in that port, I'm really baffled !!

a little help for a friend?

28th February, 2018

javineo started a new conversation Guzzle And Problem In Port:80 • 3 months ago

I have not been able to discover what problem my code has.

I have an API made in Laravel, which for security reasons I access from port 7744 on the web front, when consulting it from another site, I get the error

'cURL error 7: Failed to connect to http: // myhost: 7744 / api / v1 / port 7744: Connection refused'

if I return to enable port 80 then it works. Can someone guide me in the solution?

2nd February, 2018

javineo left a reply on Date Format In The View. Laravel 5.5 • 4 months ago

and how do I use it in the view?

javineo left a reply on Date Format In The View. Laravel 5.5 • 4 months ago

This is my model:

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Casos extends Model
{
        /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $table = 'casos';

    public $timestamps = false;

}

javineo started a new conversation Date Format In The View. Laravel 5.5 • 4 months ago

I need to show the date extracted from a database from a model in a controller and sent to the view. The format that is given to me is the following: "2018-02-02 00: 00: 00.000". And I need it to look like this: "02/02/2018". I do not want to use hard code in the view.

Total Thanks!

31st January, 2018

javineo started a new conversation Customize Laravel Authentication 5.5 ... It's Possible? • 4 months ago

I think I did not express myself correctly. I want to be able to use the entire structure that Laravel 5.5 offers to build a Login for my web application, but. . . not with default tables such as USERS or the user is an email, or you have to use seeders. For example: My table is called "contacts" the fields that intervene in the login are only the user, and its field name is "login_id" and its password whose field is called "pass_id" and I do not need to do password recovery or new user records since it is a closed application for local use. If someone can help me, I will be eternally grateful.

Many Greetings and Thanks to all.

javineo left a reply on Authentication With Laravel 5.5 • 4 months ago

I think I did not express myself correctly. I want to be able to use the entire structure that Laravel 5.5 offers to build a Login for my web application, but. . . not with default tables such as USERS or the user is an email, or you have to use seeders. For example: My table is called "contacts" the fields that intervene in the login are only the user, and its field name is "login_id" and its password whose field is called "pass_id" and I do not need to do password recovery or new user records since it is a closed application for local use. If someone can help me, I will be eternally grateful.

Many Greetings and Thanks to all.

javineo left a reply on Authentication With Laravel 5.5 • 4 months ago

@st8113, Your video is good, but I need to modify Login and not Register. Will you have a video or tutorial where it is modified with success Login?

Very thankful!!

30th January, 2018

javineo left a reply on Authentication With Laravel 5.5 • 4 months ago

is_user is numeric 1 or 0 login_id is varchar of 20 pass_id is varchar of 20

those are the fields that I have to use

javineo left a reply on Authentication With Laravel 5.5 • 4 months ago

These are my fields in the database

is_user login_id pass_id

javineo left a reply on Authentication With Laravel 5.5 • 4 months ago

aa

javineo left a reply on Authentication With Laravel 5.5 • 4 months ago

Well really very illustrative videos, but I need to authenticate with a database already used by other software, I must adapt to that, which means that I can not use seeders or use pre-existing models. Any suggestions on how to do it or where to direct my search?

Thank you again, everyone!

javineo started a new conversation Authentication With Laravel 5.5 • 4 months ago

I have followed the instructions of Laravel 5.5 below:

https://laravel.com/docs/5.5/authentication#introduction-database-considerations

As it says in the item: Authentication Quickstart, everything is created as it is named there, but I can not understand how it works.

Does anyone know where I can nourish myself so that the subject is better explained?

Thank you so much!!

17th January, 2018

javineo started a new conversation L5.3 To L 5.4 (1/1) BadMethodCallException Call To Undefined Method Illuminate\Database\Query\Builder::findBySlug() • 5 months ago

In the endless migration of Laravel 5.3 to Laravel 5.4 I have encountered a new problem and it is this error:

(1/1) BadMethodCallException
Call to undefined method Illuminate\Database\Query\Builder::findBySlug()

in Builder.php (line 2445)
at Builder->__call('findBySlug', array('consultas'))
in Builder.php (line 1254)
at Builder->findBySlug('consultas')
in Builder.php (line 1254)
at Builder->__call('findBySlug', array('consultas'))
in Model.php (line 1374)
at Builder->findBySlug('consultas')
in Model.php (line 1374)

I intuit that the problem is related to:

::findBySlug()

He used it in various models and controllers.

javineo left a reply on "SluggableServiceProvider.php Does Not Exist Anymore?" • 5 months ago

After much reneging and reneging he took the key. Now he threw me another error:

(1/1) FatalErrorException
Interface 'Cviebrock\EloquentSluggable\SluggableInterface' not found

what is the replacement?

javineo left a reply on "SluggableServiceProvider.php Does Not Exist Anymore?" • 5 months ago

These are the steps I followed:

config/app.php


    'key' => env('APP_KEY'),

    'cipher' => 'AES-256-CBC',


in console:

[email protected] MINGW64 /c/NeoWebServer/www/homebanking54
$ php artisan config:cache
Configuration cache cleared!
Configuration cached successfully!

[email protected] MINGW64 /c/NeoWebServer/www/homebanking54
$ php artisan key:generate
Application key [base64:dHICEHz2Iayv74DlpUsW4lLZtqBi1M6QPSmeoChq+7Q=] set successfully.

[email protected] MINGW64 /c/NeoWebServer/www/homebanking54
$ php artisan serve
Laravel development server started: <http://127.0.0.1:8000>
[Wed Jan 17 11:20:15 2018] 127.0.0.1:59243 [200]: /favicon.ico
[Wed Jan 17 11:20:17 2018] 127.0.0.1:59245 [200]: /favicon.ico
[Wed Jan 17 11:20:18 2018] 127.0.0.1:59247 [200]: /favicon.ico
[Wed Jan 17 11:20:18 2018] 127.0.0.1:59249 [200]: /favicon.ico
[Wed Jan 17 11:20:19 2018] 127.0.0.1:59251 [200]: /favicon.ico
[Wed Jan 17 11:20:19 2018] 127.0.0.1:59253 [200]: /favicon.ico
[Wed Jan 17 11:20:19 2018] 127.0.0.1:59255 [200]: /favicon.ico
[Wed Jan 17 11:20:19 2018] 127.0.0.1:59257 [200]: /favicon.ico
[Wed Jan 17 11:20:20 2018] 127.0.0.1:59259 [200]: /favicon.ico
[Wed Jan 17 11:20:32 2018] 127.0.0.1:59260 Invalid request (Unexpected EOF)

in the web:

(1/1) RuntimeException
The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.

javineo left a reply on "SluggableServiceProvider.php Does Not Exist Anymore?" • 5 months ago

Hello again. Thanks for the advice on threads. I can not find where my mind played a trick on me:

[email protected] MINGW64 /c/NeoWebServer/www/homebanking54
$ php artisan config:cache
Configuration cache cleared!
Configuration cached successfully!

[email protected] MINGW64 /c/NeoWebServer/www/homebanking54
$ php artisan key:generate
Application key [base64:3o2dSkCnADXwP8Ool3/Qb6I7bfYSMR4CJYmYCbeQlVM=] set successfully.

[email protected] MINGW64 /c/NeoWebServer/www/homebanking54

Then I did the following in my app.php:

    /*
    |--------------------------------------------------------------------------
    | Encryption Key
    |--------------------------------------------------------------------------
    |
    | This key is used by the Illuminate encrypter service and should be set
    | to a random, 32 character string, otherwise these encrypted strings
    | will not be safe. Please do this before deploying an application!
    |
    */

    'key' => env('3o2dSkCnADXwP8Ool3/Qb6I7bfYSMR4CJYmYCbeQlVM=3o2dSkCnADXwP8Ool3/Qb6I7bfYSMR4CJYmYCbeQlVM='),

    'cipher' => 'AES-256-CBC',



y a pesar de ellos sigue dando el error:

(1/1) RuntimeException
The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.

Surely something I have done wrong and I am not realizing.

javineo left a reply on "SluggableServiceProvider.php Does Not Exist Anymore?" • 5 months ago

OK, your advice went well! Now he gave me this other error:

RuntimeException
The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.

and this is mi app.php code:

    /*
    |--------------------------------------------------------------------------
    | Encryption Key
    |--------------------------------------------------------------------------
    |
    | This key is used by the Illuminate encrypter service and should be set
    | to a random, 32 character string, otherwise these encrypted strings
    | will not be safe. Please do this before deploying an application!
    |
    */

    'key' => env('HomeBankingNeoConsulToR3sS4'),

    'cipher' => 'AES-256-CBC',



is correct?

javineo started a new conversation "SluggableServiceProvider.php Does Not Exist Anymore?" • 5 months ago

At the moment I am trying to migrate my project from Laravel 5.3 (working) to Laravel 5.4 and I have found the following error:

(1/1) FatalErrorException
Class 'Cviebrock\EloquentSluggable\SluggableServiceProvider' not found

in ProviderRepository.php (line 208)

This is my composer.json:

    "require": {
        "php": ">=5.6.4",
        "barryvdh/laravel-dompdf": "^0.8.1",
        "cviebrock/eloquent-sluggable": "^4.2",
        "guzzlehttp/guzzle": "^6.3",
        "laravel/framework": "5.4.*",
        "laravel/tinker": "~1.0",
        "laravelcollective/html": "^5.4",
        "laravelcollective/remote": "^5.4",
        "nesbot/carbon": "^1.22"
    },

and this is the code of my app.php :

    'providers' => [

        /*
         * Laravel Framework Service Providers...
         */
        Illuminate\Auth\AuthServiceProvider::class,
        Illuminate\Broadcasting\BroadcastServiceProvider::class,
        Illuminate\Bus\BusServiceProvider::class,
        Illuminate\Cache\CacheServiceProvider::class,
        Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
        Illuminate\Cookie\CookieServiceProvider::class,
        Illuminate\Database\DatabaseServiceProvider::class,
        Illuminate\Encryption\EncryptionServiceProvider::class,
        Illuminate\Filesystem\FilesystemServiceProvider::class,
        Illuminate\Foundation\Providers\FoundationServiceProvider::class,
        Illuminate\Hashing\HashServiceProvider::class,
        Illuminate\Mail\MailServiceProvider::class,
        Illuminate\Notifications\NotificationServiceProvider::class,
        Illuminate\Pagination\PaginationServiceProvider::class,
        Illuminate\Pipeline\PipelineServiceProvider::class,
        Illuminate\Queue\QueueServiceProvider::class,
        Illuminate\Redis\RedisServiceProvider::class,
        Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
        Illuminate\Session\SessionServiceProvider::class,
        Illuminate\Translation\TranslationServiceProvider::class,
        Illuminate\Validation\ValidationServiceProvider::class,
        Illuminate\View\ViewServiceProvider::class,
        Collective\Html\HtmlServiceProvider::class,
        Barryvdh\DomPDF\ServiceProvider::class,
        Collective\Html\HtmlServiceProvider::class,
        Cviebrock\EloquentSluggable\SluggableServiceProvider::class,
        Collective\Remote\RemoteServiceProvider::class,

        /*
         * Package Service Providers...
         */
        Laravel\Tinker\TinkerServiceProvider::class,

        /*
         * Application Service Providers...
         */
        App\Providers\AppServiceProvider::class,
        App\Providers\AuthServiceProvider::class,
        // App\Providers\BroadcastServiceProvider::class,
        App\Providers\EventServiceProvider::class,
        App\Providers\RouteServiceProvider::class,
        App\Providers\ComposerServiceProvider::class,

    ],


I could also notice that in:

\vendor\cviebrock\eloquent-sluggable\src

does not contain the file:

SluggableServiceProvider.php

If someone can guide me on how to get out of this quagmire, I thank you.

16th January, 2018

javineo left a reply on ErrorException In UrlGenerator.php Line 314 • 5 months ago

Laravel Collective package 5.3 was correctly updated. It seems that the problem went through the Resource of the routes and their prefix:

{!! Form::model($slider, ['route' => ['admin.slider.update', $slider->id], 'method' => 'PUT', 'files' => true, 'autocomplete' => 'off']) !!}    ...

It was replaced by the following code and it worked:

{!! Form::model($slider, ['route' => ['slider.update', $slider->id], 'method' => 'PUT', 'files' => true, 'autocomplete' => 'off']) !!}    ...

javineo started a new conversation ErrorException In UrlGenerator.php Line 314 • 5 months ago

I have taken my project from Laravel 5.2 to Laravel 5.3 and I have come across the following error:

ErrorException in UrlGenerator.php line 314:
Route [admin.slider.update] not defined. (View: C:\NeoWebServer\www\homebanking53\resources\views\admin\slider\edit.blade.php)

the error is produced by the following view:


{!! Form::model($slider, ['route' => ['admin.slider.update', $slider->id], 'method' => 'PUT', 'files' => true, 'autocomplete' => 'off']) !!}    ...

and here the route that calls the blade:

Route::group(['prefix' => 'admin'], function(){
    Route::get('/login', '[email protected]');
    Route::post('/login', '[email protected]');

    Route::group(['middleware' => 'auth'], function(){
        Route::get('/',         '[email protected]'     );
        Route::get('/perfil',   '[email protected]'    );
        Route::get('/config',   '[email protected]'    );
        Route::get('/conexion', '[email protected]'  );
        Route::get('/logout',   '[email protected]'    );

        Route::post('/perfil',  '[email protected]');
        Route::post('/config',  '[email protected]');
        Route::post('/conexion/test', '[email protected]');

        #Configuracion
        Route::group(['prefix' => 'config'], function(){
            Route::get('/modulos',          '[email protected]');
            Route::get('/{slug}',           '[email protected]');
            Route::get('/consultas',        '[email protected]');
            //Route::get('/operaciones',        '[email protected]'); 

            Route::group(['prefix' => 'consultas'], function(){
                Route::get('/{slug}',       '[email protected]'    );     
                Route::post('/procesar',    '[email protected]');
            });

            Route::post('/servicios',       '[email protected]');
            Route::post('/modulos',         '[email protected]');
        });

        #Recursos
        Route::resource('/slider',      'SliderController'  );
        Route::resource('/faq',         'FaqController'     );
        Route::resource('/sucursales',  'SucursalController');
        Route::resource('/messages',    'MessageController' );
    });


a little help for a friend

Tanks

15th January, 2018

javineo left a reply on Other Laravel 4.2 To Laravel 5.0 • 5 months ago

I reviewed the explained and I managed to adapt the code to my needs. They are only 3 sections so what solutions do the following:

@if(Session::has('es_socio') && Session::get('es_socio') == '1' && $modulo[0]->socios && $modulo[0]->getItemsEnabled('escritorio') > 0)

and for the other section the corresponding:

@if(Session::has('es_socio') && Session::get('es_socio') == '1' && $modulo[1]->socios && $modulo[1]->getItemsEnabled('escritorio') > 0)

and the third and last section not yet the development.

Thanks for your help Dutch Wandering

javineo left a reply on Other Laravel 4.2 To Laravel 5.0 • 5 months ago

This is the result of dd ($ module);

Collection {#335 ▼
  #items: array:3 [▼
    0 => Modulo {#336 ▼
      #sluggable: array:2 [▼
        "build_from" => "modulo"
        "save_to" => "slug"
      ]
      #table: "modules"
      +timestamps: false
      #connection: null
      #primaryKey: "id"
      #perPage: 15
      +incrementing: true
      #attributes: array:7 [▼
        "id" => 1
        "modulo" => "Consultas"
        "socios" => 1
        "comercios" => 1
        "socios_redireccion" => ""
        "comercios_redireccion" => ""
        "slug" => "consultas"
      ]
      #original: array:7 [▼
        "id" => 1
        "modulo" => "Consultas"
        "socios" => 1
        "comercios" => 1
        "socios_redireccion" => ""
        "comercios_redireccion" => ""
        "slug" => "consultas"
      ]
      #relations: []
      #hidden: []
      #visible: []
      #appends: []
      #fillable: []
      #guarded: array:1 [▼
        0 => "*"
      ]
      #dates: []
      #casts: []
      #touches: []
      #observables: []
      #with: []
      #morphClass: null
      +exists: true
    }
    1 => Modulo {#337 ▼
      #sluggable: array:2 [▼
        "build_from" => "modulo"
        "save_to" => "slug"
      ]
      #table: "modules"
      +timestamps: false
      #connection: null
      #primaryKey: "id"
      #perPage: 15
      +incrementing: true
      #attributes: array:7 [▼
        "id" => 2
        "modulo" => "Operaciones"
        "socios" => 1
        "comercios" => 1
        "socios_redireccion" => ""
        "comercios_redireccion" => ""
        "slug" => "operaciones"
      ]
      #original: array:7 [▼
        "id" => 2
        "modulo" => "Operaciones"
        "socios" => 1
        "comercios" => 1
        "socios_redireccion" => ""
        "comercios_redireccion" => ""
        "slug" => "operaciones"
      ]
      #relations: []
      #hidden: []
      #visible: []
      #appends: []
      #fillable: []
      #guarded: array:1 [▼
        0 => "*"
      ]
      #dates: []
      #casts: []
      #touches: []
      #observables: []
      #with: []
      #morphClass: null
      +exists: true
    }
    2 => Modulo {#338 ▼
      #sluggable: array:2 [▼
        "build_from" => "modulo"
        "save_to" => "slug"
      ]
      #table: "modules"
      +timestamps: false
      #connection: null
      #primaryKey: "id"
      #perPage: 15
      +incrementing: true
      #attributes: array:7 [▼
        "id" => 3
        "modulo" => "Servicios Moviles"
        "socios" => 0
        "comercios" => 0
        "socios_redireccion" => ""
        "comercios_redireccion" => ""
        "slug" => "servicios-moviles"
      ]
      #original: array:7 [▼
        "id" => 3
        "modulo" => "Servicios Moviles"
        "socios" => 0
        "comercios" => 0
        "socios_redireccion" => ""
        "comercios_redireccion" => ""
        "slug" => "servicios-moviles"
      ]
      #relations: []
      #hidden: []
      #visible: []
      #appends: []
      #fillable: []
      #guarded: array:1 [▼
        0 => "*"
      ]
      #dates: []
      #casts: []
      #touches: []
      #observables: []
      #with: []
      #morphClass: null
      +exists: true
    }
  ]
}

12th January, 2018

javineo started a new conversation Other Laravel 4.2 To Laravel 5.0 • 5 months ago

My problems continue making Laravel 4.2 become Laravel 5.0.

This is a error:

Undefined property: Illuminate\Database\Eloquent\Collection::$socios (View: C:\NeoWebServer\www\homebanking5\resources\views\submenus\operaciones.blade.php) 

line of code that gives the eror in the view

@if(Session::has('es_socio') && Session::get('es_socio') == '1' && $modulo->socios && $modulo->getItemsEnabled('escritorio') > 0)

$ module comes from model Model.php

    public function getItemsEnabled($menu = 'escritorio'){
        $count = 0;
        
        foreach($this->items as $i){
            if($i->$menu){
                $count++;
            }
            Log::info($count);
        }

        return $count;

What is my mistake? I can not understand what happens, I appreciate if someone can help me with this new error.

javineo left a reply on Syntax For Route::group L4 To L5 • 5 months ago

It works perfectly. Total Thanks!

javineo left a reply on Syntax For Route::group L4 To L5 • 5 months ago

ok.

the middleware code (valida_modulo.php).

    public function handle($request, Closure $next, $section)
    {
        $sgment     = strip_tags(Request::segment(1));
        $modulo     = Modulo::findBySlug($sgment);
        $sections   = ['socios', 'comercios'];
        
    
        #Si no existe el modulo, o si el modulo esta habilitado pero esta seccion no o si la seccion no corresponde a una seccion valida, redireccion
        if(!$modulo || (!Modulo::enabled($sgment) || !$modulo->$section) || !in_array($section, $sections)){
            if(Request::ajax()){
                return Response::json(['success' => false, 'error' => 'La sección no se encuentra habilitada o no existe. Por favor contacta un administrador del sistema.']);
            }else{
                $redireccion = $section.'_redireccion';
                //Log::info($redireccion);
    
                #Si la URL de redireccion está vacía redireccionamos a 404.
                if($modulo->$redireccion == '' || $modulo->$redireccion == '404' || $modulo->$redireccion == '/404'){           
                    return Redirect::to('/404')->withErrors(['disabled' => 'La sección no se encuentra habilitada o no existe.']);
                }
    
                #Si contiene datos redireccionamos a la url seleccionada.
                return Redirect::to($modulo->$redireccion);
            }
        }
            
        return $next($request);
    }

In this way the code gives me the following error:

[2018-01-12 13:53:34] local.ERROR: exception 'ErrorException' with message 'Missing argument 3 for App\Http\Middleware\valida_modulo::handle(), called in C:\NeoWebServer\www\homebanking5\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php on line 125 and defined' in C:\NeoWebServer\www\homebanking5\app\Http\Middleware\valida_modulo.php:21

Line 21 of code corresponds to:

    public function handle($request, Closure $next, $section)

and the route code is:

    Route::get('/operaciones', ['uses' => '[email protected]', 'middleware' => 'valida_modulo:socios']);
    Route::group(['prefix' => 'operaciones'], function(){
        #Socios
        Route::group(['middleware' => ['socio','valida_modulo:socios']], function(){......

javineo left a reply on Syntax For Route::group L4 To L5 • 5 months ago

I do not want to abuse your will to help me, but can you give me an example of how to do it?

javineo left a reply on Syntax For Route::group L4 To L5 • 5 months ago

I think I left my question incomplete. Here my doubt seen with more presision

In Laravel 4.2 parameter "socios"


Route::group(['before' => 'socio|valida_modulo:socios'], function(){ .....

In Laravel 5.0 I do not know how to send the parameter "socios"?

Route::group(['middleware' => ['socio','valida_modulo']], function(){ ....

sorry for my oblivion.

Thank you

javineo started a new conversation Syntax For Route::group L4 To L5 • 5 months ago

I'm trying to take my project from Laravel 4.2 to Laravel 5.0 and in the file route.php I found some inconveniences.

Laravel 4.2 code in route.php

    Route::group(['prefix' => 'operaciones'], function(){
        #Socios
        Route::group(['before' => 'socio|valida_modulo:socios'], function(){
            Route::get('/transferencias',   '[email protected]');
            Route::get('/pagos/tarjetas',   '[email protected]' );
            Route::get('/pagos/prestamos',  '[email protected]');
            Route::get('/pagos/servicios',  '[email protected]');
            Route::get('/amt',              '[email protected]'   );


and this is a code in Laravel 5.0 route.php file:

    Route::group(['prefix' => 'operaciones'], function(){
        #Socios
        Route::group(['middleware' => ['socio','valida_modulo']], function(){
            Route::get('/transferencias',   '[email protected]');
            Route::get('/pagos/tarjetas',   '[email protected]' );
            Route::get('/pagos/prestamos',  '[email protected]');
            Route::get('/pagos/servicios',  '[email protected]');
            Route::get('/amt',              '[email protected]'   );


Is the code well converted? Is the syntax correct?

Tanks!!

11th January, 2018

javineo left a reply on IsMobile() Undefined Function • 5 months ago

OK thanks. That closing of PHP tag was filtered when I copied it, it is not in the real file, it was a transferred error but not operative.

javineo left a reply on IsMobile() Undefined Function • 5 months ago

1 - We created a Helpers folder inside the app directory to maintain the order.

app/Helpers

2 -We create a helpers.php file inside the new Helpers folder with the following code:

<?php

    function isMobile() {
        return preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER["HTTP_USER_AGENT"]);
    }
    
?>

3- Next we add some lines to the composer.json

    "autoload": {
        "classmap": [
            "database"

        ],
        "psr-4": {
            "App\": "app/"
        },
        "files": [
            "app/Helpers/helpers.php"
        ]
    },

4- Finally on the console

composer dump-autoload

5- Now in any part of the project we use helper created.

    @if($total_cuentas > 0 &&  ( ( !isMobile() && $servicios[0]->escritorio ) || ( isMobile() && $servicios[0]->movil ) ) )
        <!-- CUENTAS -->
        
        <div class="box">
            <div class="box-title">
                <h3><i class="fa fa-angle-down"></i> Cuentas de Ahorro Variable</h3>
            </div>
            <div id="cta-ahorro" class="box-content active">
                {!!$cuentas!!}
            </div>
        </div>
        
    @endif


Finally, I will achieve the solution, many thanks for the suggestions.

10th January, 2018

javineo left a reply on IsMobile() Undefined Function • 5 months ago

Sincerely I dont know.

This code had it working well in Laravel 4.2 and it stopped working when I took it to Laravel 5.0

I also do not know which Laravel wrappers to change for Mobiledetect.

javineo left a reply on IsMobile() Undefined Function • 5 months ago

This is mi lene code in view:

@if($total_cuentas > 0 &&  ( ( !isMobile() && $servicios[0]->escritorio ) || ( isMobile() && $servicios[0]->movil ) ) )

javineo left a reply on IsMobile() Undefined Function • 5 months ago

mobiledetect/mobiledetectlib 2.8.30 and i have php 5.6.7

javineo started a new conversation IsMobile() Undefined Function • 5 months ago

Hello again.

My problem is the following: ´´´ [2018-01-10 14:11:11] local.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to undefined function isMobile()' in C:\NeoWebServ.....

´´´

Therefore, I deduced that the mobiledetect library is not working. Can anyone guide me on how to install the mobiledect library in Laravel 5.0 and how to invoke it later from a view?

4th January, 2018

javineo left a reply on Undefined Property: Illuminate\Database\Eloquent\Collection::$socios • 5 months ago

I solved it by paying attention to your instructions.

Replace:

@if(session()->has('es_socio') && session()->get('es_socio') == '1' && (Request::segment(2) === null || Request::segment(2) == 'resumen' || Request::segment(2) == 'consumos' || Request::segment(2) == 'dtohabermax') && $modulo->socios)

For this:

@if(session()->has('es_socio') && session()->get('es_socio') == '1' && (Request::segment(2) === null || Request::segment(2) == 'resumen' || Request::segment(2) == 'consumos' || Request::segment(2) == 'dtohabermax') && $modulo[0]->socios)

I use Modulo :: all (); as a global variable. In other views I use for each.

Total Thanks

javineo started a new conversation Undefined Property: Illuminate\Database\Eloquent\Collection::$socios • 5 months ago

Hello,

I have not been able to get out of this problem, I can not guide myself on how to solve it.

It gives me an error that I do not realize where to fix it.

DB Access:

class Modulo extends Model implements SluggableInterface {


    use SluggableTrait;

    protected $sluggable = array(
        'build_from' => 'modulo',
        'save_to'    => 'slug',
    );



    /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $table = 'modules';

    public $timestamps = false;

Now ProfileComposer:

    public function compose(View $view)
    {
        $conf= Conf::first();
        $modulos= Modulo::all();
        //$users = User::all();
        $view->with('conf', $conf)->with('modulo', $modulos);
    }

View Code:

        @if(session()->has('es_socio') && session()->get('es_socio') == '1' && (Request::segment(2) === null || Request::segment(2) == 'resumen' || Request::segment(2) == 'consumos' || Request::segment(2) == 'dtohabermax') && $modulo->socios)


And this is a error:

Undefined property: Illuminate\Database\Eloquent\Collection::$socios (View: C:\NeoWebServer\www\proyecto\resources\views\submenus\consultas.blade.php)

If someone can help me, I thank you.

Total Thanks

javineo left a reply on Global Var From 4. To 5.0 • 5 months ago

Thank you very much, the problem with the information sent was resolved.

regards

28th December, 2017

javineo started a new conversation Global Var From 4. To 5.0 • 5 months ago

I am taking my Laravel 4.2 project to Laravel 5.0 on my rutes.php is headed by:

View::composer('*', '[email protected]');

And it does not work in Laravel 5.0. Does anyone know how to help me with this problem?

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.