ljlizarraga

ljlizarraga

Member Since 1 Year Ago

VALENCIA

SEO at Wicom, C.A

Experience Points 10,990
Experience Level 3

4,010 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 107
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.

11 Sep
1 week ago

ljlizarraga started a new conversation Error

UnexpectedValueException The Response content must be a string or object implementing __toString(), "object" given.

    <?phpnamespace App\Http\Controllers;//use App\Transaction;  
use Carbon\Carbon;  
use Freshwork\Transbank\CertificationBagFactory;  
use Freshwork\Transbank\RedirectorHelper;  
use Freshwork\Transbank\TransbankServiceFactory;  
use Freshwork\Transbank\WebpayOneClick;  
use Illuminate\Http\Request;  
use App\Http\Requests;  
use Freshwork\Transbank\WebpayNormal;class WebPayController extends Controller  
{  
  protected $oneclick;  
  //  
  public function __construct()  
  {  
      $bag = CertificationBagFactory::integrationOneClick();  
      $this->oneclick = TransbankServiceFactory::oneclick($bag);  
      //$this->middleware('auth');  
  }    public function index(){  
      return view('layouts.pages.pagoFacil');  
  }  
  public function Pagar(WebpayNormal $webPayNormal,Request $request)  
      {  
     // $webPayNormal = new( webPayNormal());  
      $webPayNormal->addTransactionDetail(1500, 'order-' . rand(1000, 9999));  
      return $webPayNormal;  
              $response = $webPayNormal->initTransaction(route('pagoFacil.webpay.response'), route('pagoFacil.webpay.finish'));  
              // Probablemente también quieras crear una orden o transacción en tu base de datos y guardar el token ahí.  
                  
      return RedirectorHelper::redirectHTML($response->url, $response->token);  
      }  
}

enter image description here

10 Dec
9 months ago

ljlizarraga left a reply on How To Loop Through Multiple Result Sets From Stored Procedure In Laravel?

Hey good morning. If you take a look at the image, you will see that both results are different from each other yet necessary for the data that I need, and this is how the QUERY functions in the Store Procedure. I need this to run in PHP , NOT net core. Thank you so much.

09 Dec
9 months ago

ljlizarraga started a new conversation How To Loop Through Multiple Result Sets From Stored Procedure In Laravel?

Im slightly going out of my mind trying to get 3 result sets from a stored procedure (SP) in SQL server 2012.

EXAMPLE

CREATE PROCEDURE db_abbTest
AS
BEGIN
        SET NOCOUNT ON;

        SELECT 1
        SELECT 2
        SELECT 3
        RETURN 0
END
GO

The SP returns three results (3x select statements) however i cannot seem to get all of the results back from the query. Any Ideas? I have tried while(sqlsrv_fetch_object($r){//do something}) but no luck..

Please help me !!!

here a example real

ljlizarraga left a reply on After Login User, Redirect To Specific Path

@SANJAYACLOUD - It's a package of permissions

https://github.com/spatie/laravel-permission/

I created roles and assigned them, or you can add them in the user table

how do you identify administrator user ?

I do not write english well Hope it's understandable

07 Dec
9 months ago

ljlizarraga left a reply on After Login User, Redirect To Specific Path

example with laravel permissions

laravel/app/Http/Controllers/Auth/LoginController.php

public function redirectPath()
    {
        if (auth()->user()->hasRole('Admin|Writer')){
            return '/admin';
        }
        elseif (auth()->user()->hasRole('Users')){
            return '/users';
        }
        
        /*default case for others */
        return  view('pages.home');
    }
30 Aug
1 year ago

ljlizarraga started a new conversation How Can I Specify The Database Connection From The Login In Laravel

I currently have three databases with the same scheme, and I need to specify from the login the connection to use .... some idea... how can I do it

31 May
1 year ago

ljlizarraga left a reply on ReflectionException (-1) Class App\policies\RolePolicy Does Not Exist

@tykus Thank you, that's all.... @nolros Thank you dude...

Do you know why that error?

I do not speak English well

30 May
1 year ago

ljlizarraga left a reply on ReflectionException (-1) Class App\policies\RolePolicy Does Not Exist

yes nolros i do it

<?php  
  
namespace App\Providers;  
  
use Illuminate\Support\Facades\Gate;  
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;  
  
class AuthServiceProvider extends ServiceProvider  
{  
  /**  
 * The policy mappings for the application. * * @var array  
 */  protected $policies = [  
  'App\User' => 'App\Policies\UserPolicy',  
  'App\Post' => 'App\Policies\PostPolicy',  
  'Spatie\Permission\Models\Role' => 'App\policies\RolePolicy',  
  'Spatie\Permission\Models\Permission' => 'App\policies\PermissionPolicy'  
  ];  
  
  /**  
 * Register any authentication / authorization services. * * @return void  
 */  public function boot()  
 {  $this->registerPolicies();  
  
  //  
  }  
}

RolesController

<?php  
  
namespace App\Http\Controllers\Admin;  
  
use Illuminate\Http\Request;  
use Spatie\Permission\Models\Role;  
use App\Http\Controllers\Controller;  
use App\Http\Requests\SaveRolesRequest;  
use Spatie\Permission\Models\Permission;  
  
class RolesController extends Controller  
{  
  /**  
 * Display a listing of the resource. * * @return \Illuminate\Http\Response  
 */  public function index()  
 {  $this->authorize('view', $role = new Role);  
  return view('admin.roles.index', [  
  'roles' => Role::all()  
 ]);  
  }  
  
  /**  
 * Show the form for creating a new resource. * * @return \Illuminate\Http\Response  
 */  public function create()  
 {  $this->authorize('create', $role = new Role);  
  
  return view('admin.roles.create', [  
  'role' => $role,  
  'permissions' => Permission::pluck('name', 'id')  
 ]);  
  }  
  
  /**  
 * Store a newly created resource in storage. * * @param \Illuminate\Http\Request  $request  
 * @return \Illuminate\Http\Response  
 */  public function store(SaveRolesRequest $request)  
 {  $this->authorize('create', new Role);  
  
  $role = Role::create($request->validated());  
  
  if ($request->has('permissions'))  
 {  $role->givePermissionTo($request->permissions);  
  }  
  return redirect()->route('admin.roles.index')  
 ->withFlash('El role fue creado sastifactoriamente');  
  }  
  
  /**  
 * Show the form for editing the specified resource. * * @param int  $id  
 * @return \Illuminate\Http\Response  
 */  public function edit(Role $role)  
 {  $this->authorize('update', $role);  
  
  return view('admin.roles.edit', [  
  'role' => $role,  
  'permissions' => Permission::pluck('name', 'id')  
 ]);  
  }  
  
  /**  
 * Update the specified resource in storage. * * @param \Illuminate\Http\Request  $request  
 * @param int  $id  
 * @return \Illuminate\Http\Response  
 */  public function update(SaveRolesRequest $request, Role $role)  
 {  $this->authorize('update', $role);  
  
  $role->update($request->validated());  
  
  $role->permissions()->detach();  
  
  if ($request->has('permissions'))  
 {  $role->givePermissionTo($request->permissions);  
  }  
  
  return redirect()->route('admin.roles.edit', $role)  
 ->withFlash('El role fue actualizado correctaente');  
  
  }  
  
  /**  
 * Remove the specified resource from storage. * * @param int  $id  
 * @return \Illuminate\Http\Response  
 */  public function destroy(Role $role)  
 {  $this->authorize('delete', $role);  
  
  $role->delete();  
  return redirect()->route('admin.roles.index')  
 ->withFlash('El role: ' . strtoupper($role->name) . ' fue eliminado.' );  
  }  
}

RESULT

HERE ERROR!!!

29 May
1 year ago

ljlizarraga left a reply on ReflectionException (-1) Class App\policies\RolePolicy Does Not Exist

**

same error

** ReflectionException (-1) Class App\policies\RolePolicy does not exist

 public function index()
{
    $this->authorize('view', Role::class);
    return view('admin.roles.index', [
        'roles' => Role::all()
    ]);
}

ljlizarraga started a new conversation ReflectionException (-1) Class App\policies\RolePolicy Does Not Exist

**

I am using laravel 5.6 My

> **/app/Http/Controllers/Admin/RolesController.php** 

looks like that:

**

<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use Spatie\Permission\Models\Role;
use App\Http\Controllers\Controller;
use App\Http\Requests\SaveRolesRequest;
use Spatie\Permission\Models\Permission;
use App\policies\RolePolicy;

class RolesController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
       $this->authorize('view', $role = new Role);  //PROBLEM IS HERE
        return view('admin.roles.index', [
            'roles' => Role::all()
        ]);
    } 
 }

20 Apr
1 year ago

ljlizarraga left a reply on Deploy On Shared Server

My solution here:

rename the project folder to laravel

rename and move /laravel/public to /public_html

structure example

/laravel /public_html

in public_html/index.php

change require DIR.'/../vendor/autoload.php'; for require DIR.'/../laravel/vendor/autoload.php'; change $app = require_once DIR.'/../bootstrap/app.php'; for $app = require_once DIR.'/../laravel/bootstrap/app.php';

in /laravel/app/Providers/AppServiceProvider.php

paste this

/**
 * Register any application services.
 *
 * @return void
 */
public function boot()
{
    Schema::defaultStringLength(191);
}
public function register()
{
    $this->app->bind('path.public', function (){
        return base_path().'/../public_html';
    });
}

------------------------------------------

composer update

npm install

example

mix.setPublicPath('../public_html');

mix.js('resources/assets/js/app.js', 'asset/js') .sass('resources/assets/sass/app.scss', 'asset/css');

//browserSync Example too..

mix.browserSync({ proxy: 'http://project.dev', //browser: ["google chrome", "firefox"], open: false, files: [ 'app//', '../public_html//', 'resources/views//', 'resources/lang//', 'resources/assets//', 'routes//' ], /* notify: { styles: { top: 'auto', bottom: '0' } },*/ });