luisgarciaalanis

luisgarciaalanis

Member Since 4 Years Ago

Experience Points 2,405
Experience Level 1

2,595 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 74
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.

06 Mar
3 years ago

luisgarciaalanis left a reply on Homestead 2.0 Not Working

Forgot to mention: - Can only install one of: symfony/process[v2.1.9, v3.0.3]. - Can only install one of: symfony/process[v2.2.0, v3.0.3]. - Can only install one of: symfony/process[v2.2.1, v3.0.3]. - Can only install one of: symfony/process[v2.2.10, v3.0.3]. - Can only install one of: symfony/process[v2.2.11, v3.0.3]. - Can only install one of: symfony/process[v2.2.2, v3.0.3]. - Can only install one of: symfony/process[v2.2.3, v3.0.3]. - Can only install one of: symfony/process[v2.2.4, v3.0.3]. - Can only install one of: symfony/process[v2.2.5, v3.0.3]. - Can only install one of: symfony/process[v2.2.6, v3.0.3]. - Can only install one of: symfony/process[v2.2.7, v3.0.3]. - Can only install one of: symfony/process[v2.2.8, v3.0.3]. - Can only install one of: symfony/process[v2.2.9, v3.0.3]. - Installation request for symfony/process == 3.0.3.0 -> satisfiable by symfony/process[v3.0.3].

luisgarciaalanis started a new conversation Homestead 2.0 Not Working

composer global require "laravel/homestead=~2.0" Changed current directory to /home/luis/.config/composer ./composer.json has been updated 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 - Conclusion: don't install laravel/homestead v2.2.1 - Conclusion: don't install laravel/homestead v2.2.0 - Conclusion: don't install laravel/homestead v2.1.8 - Conclusion: don't install laravel/homestead v2.1.7 - Conclusion: don't install laravel/homestead v2.1.6 - Conclusion: don't install laravel/homestead v2.1.5 - Conclusion: don't install laravel/homestead v2.1.4 - Conclusion: don't install laravel/homestead v2.1.3 - Conclusion: don't install laravel/homestead v2.1.2 ...

Any ideas???

01 Mar
3 years ago

luisgarciaalanis left a reply on #Session::put() Only Works Once

Route::group(['middleware' => ['web']], function () { // put routes here }

// on controller use App; use Session;

// try using these API's Session::set('locale', 'en'); Session::set('locale', 'es'); Session::set('locale', 'fr');

App::setLocale(Session::get('locale'));

The WEB middleware enables: 'web' => [ \App\Http\Middleware\EncryptCookies::class, \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, \Illuminate\Session\Middleware\StartSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class, \App\Http\Middleware\VerifyCsrfToken::class, ],

05 Dec
3 years ago

luisgarciaalanis left a reply on Popper Way To Serve .html Files On Lumen

I ended up with a mixture of PhaxeNor, jekinney and my solution.

  1. My frontend app is currently split into a directory structure not using PSR-4 directory structure, and for good reason. Its an angular Single Page app. The idea is to serve it through a reverse proxy ngnx not lumen, so it needs decoupling.
  2. the SPA is component based and that conflicts with PSR-4 (which its designed for PHP reusability and this is not PHP), I use folders for reusable components that include all necesary files CC/HTML template/Controllers/Service, and that does not play well with PSR-4.
  3. the app will be compiled into a single file containing all CSS/JS/HTML code with the exception of large 3rd party libs like angular.
  4. at the moment the app needs to run as separate files for development and live reload. So I need a solution that would allow for single page and multi page and is weakly tied to the lumen server (just for development). 5)if I use 'views/{path:.*}' and redirect all to MainController@index then the Angular router will resolve the routes making the app behave like a multiple page app (copying URL and emailing it) while being a SPA.
  5. index can be served from one php file or hml file on resources/views like jekinney says, or bypased to the public folder, it does not matter because 100% calls will be redirected to 1 file. Decoupling and componatization is more important in the frontend for this app.
  6. Not every request gets redirected to index.php, like when you share pictures from public, or scripts..

Thanks for the help :)

luisgarciaalanis started a new conversation Popper Way To Serve .html Files On Lumen

Hello guys,

I am creating a site that serves REST apis (json). The front end is straight html using Angular.

What is the proper way to serve the index.html from the router?

$app->get('/', function() {return File::get(DIR.'../../public/admin/index.html'); }

File is not found, returns class not found.

  • Appreciate the help,
12 Nov
3 years ago

luisgarciaalanis started a new conversation How To Handle 1062 Duplicate Entry And Best Practice?

Hello guys,

I am writting an app, in this app I have a DB table with a few unique constraints on columns.

If I am to add an new row of data, how should I handle possible duplicate entries that can make eloquent/DB blow up?

Should I Query first for each possible offending column and then return an error response? or should I let it blow up and catch the exception and then return a response?

what is the best practice for this?

Thanks Luis

11 Nov
3 years ago

luisgarciaalanis started a new conversation Babel 5 Deprecated WARNING On Npm Update

Hello,

npm WARN deprecated babel-core@5.8.33: Babel 5 is no longer being maintained. Upgrade to Babel 6.

I wonder if elixir can work with Babel 6?

Thanks Luis

03 Nov
3 years ago

luisgarciaalanis started a new conversation Bad Error Code In BadRouteException Is 0

Hello,

While debugging my code I found that the BadRouteException thrown when you have a bad route has the error code of 0. I think it should be 500 (internal server error).

dd($e); shows:

BadRouteException {#139 #message: "Static route "/api/v1/test/top" is shadowed by previously defined variable route "/api/v1/test/([^/]+)" for method "GET"" #code: 0 #file: "/home/vagrant/Code/lumen/prject/vendor/nikic/fast-route/src/DataGenerator/RegexBasedAbstract.php" #line: 64 ......

I have created an issue: https://github.com/nikic/FastRoute/issues/80

Thanks Luis

02 Nov
3 years ago

luisgarciaalanis started a new conversation When To Use Lumen And When To Use Laravel?

I am currently using lumen on a project and noticed a lot of features are either disabled or missing. So I started enabling or porting the code to make the features work.

For example:

  • Sessions/Auth is stripped down
  • Custom Requests are not present
  • Eloquent is disabled
  • Blade is disabled, and some features like forms missing.

So if I start enabling all these featues then I suppose some of the speed advantages of lumen dissapear.

Where is the line were is better to use laravel instead of lumen?

Thanks Luis

15 Sep
3 years ago

luisgarciaalanis left a reply on Pattern For FlowJS: Thoughts? Would Love Input.

What is this for?, I am using flow to upload images on a test app and I use:

$request->file('file');

if works :)

13 Sep
3 years ago

luisgarciaalanis left a reply on PHPStorm Laravel Ide-helper

Found the issue, ran the command on the homestead machine and it worked :)

luisgarciaalanis left a reply on PHPStorm Laravel Ide-helper

I am seeing the same error, what do you mean by excluded the vendor file?

01 Sep
3 years ago

luisgarciaalanis started a new conversation Change Elixir Babel Source Path From Resources/assets/js To Scripts

I am writing an app that uses REST apis as backend in laravel. As front end I am using pure html5 + gulp + elixir.

I want to have a scripts folder on the root of the project containing my ES6 source files.

is it possible to tell elixir to use the scripts folder instead of resources/assets/js?

Thanks Luis

luisgarciaalanis left a reply on Elixir Babel Not Compiling ES6

I removed the offending line and added this.count in the constructor() and it works..

This video show code similar to the failing one,

https://laracasts.com/series/laravel-5-and-the-front-end/episodes/8 (see minute 7)

Did the ES6 changed?

Thanks Luis

luisgarciaalanis started a new conversation Elixir Babel Not Compiling ES6

Hello,

Gulp/elixir is having trouble compiling ES6.

I wonder what am I doing wrong?

events.js:85
      throw er; // Unhandled 'error' event
            ^
SyntaxError: /home/luis/src/web/laravel/condomanager.dev/resources/assets/js/all.js: Unexpected token (2:10)
  1 | class counter {
> 2 |     count = 0;
    |           ^
  3 |     constructor() {
  4 |         count = 1;
  5 |     }
    at Parser.pp.raise (/home/luis/src/web/laravel/condomanager.dev/node_modules/laravel-elixir/node_modules/gulp-babel/node_modules/babel-core/node_modules/babylon/lib/parser/location.js:24:13)
    at Parser.pp.unexpected (/home/luis/src/web/laravel/condomanager.dev/node_modules/laravel-elixir/node_modules/gulp-babel/node_modules/babel-core/node_modules/babylon/lib/parser/util.js:82:8)
    at Parser.pp.parseClassProperty (/home/luis/src/web/laravel/condomanager.dev/node_modules/laravel-elixir/node_modules/gulp-babel/node_modules/babel-core/node_modules/babylon/lib/parser/statement.js:624:61)
    at Parser.parseClassProperty (/home/luis/src/web/laravel/condomanager.dev/node_modules/laravel-elixir/node_modules/gulp-babel/node_modules/babel-core/node_modules/babylon/lib/plugins/flow.js:797:20)
    at Parser.pp.parseClass (/home/luis/src/web/laravel/condomanager.dev/node_modules/laravel-elixir/node_modules/gulp-babel/node_modules/babel-core/node_modules/babylon/lib/parser/statement.js:567:32)
    at Parser.pp.parseStatement (/home/luis/src/web/laravel/condomanager.dev/node_modules/laravel-elixir/node_modules/gulp-babel/node_modules/babel-core/node_modules/babylon/lib/parser/statement.js:84:19)
    at Parser.parseStatement (/home/luis/src/web/laravel/condomanager.dev/node_modules/laravel-elixir/node_modules/gulp-babel/node_modules/babel-core/node_modules/babylon/lib/plugins/flow.js:621:22)
    at Parser.pp.parseTopLevel (/home/luis/src/web/laravel/condomanager.dev/node_modules/laravel-elixir/node_modules/gulp-babel/node_modules/babel-core/node_modules/babylon/lib/parser/statement.js:30:21)
    at Parser.parse (/home/luis/src/web/laravel/condomanager.dev/node_modules/laravel-elixir/node_modules/gulp-babel/node_modules/babel-core/node_modules/babylon/lib/parser/index.js:70:17)
    at Object.parse (/home/luis/src/web/laravel/condomanager.dev/node_modules/laravel-elixir/node_modules/gulp-babel/node_modules/babel-core/node_modules/babylon/lib/index.js:45:50)

Here is my package.json

{
  "private": true,
  "devDependencies": {
    "gulp": "^3.8.8"
  },
  "dependencies": {
    "laravel-elixir": "^3.0.0",
    "bootstrap-sass": "^3.0.0"
  }
}

and gulpfile

var gulp = require('gulp');
var elixir = require('laravel-elixir');

elixir(function(mix) {
    mix.babel(['test.js']);
});

My test.js is simple

class counter {
    count = 0;
    constructor() {
        count = 1;
    }
}

Appreciate the help :)

  • Luis