rvabrazaldo

rvabrazaldo

Member Since 2 Years Ago

Experience Points 780
Experience Level 1

4,220 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.

06 Aug
1 year ago

rvabrazaldo left a reply on Is It Possible For Laravel To Have A File Listener?

nevermind @Cronix, I've got it on the console route

Artisan::command('watch', function () {

    $listener = app('watcher')->watch('C:/sample/');

    $listener->anything(function($event, $resource, $path) {
        $this->comment(Inspiring::quote());
    });

    app('watcher')->start();

})->describe('SMS Watcher');

thanks for your help, really really appreciate it

rvabrazaldo left a reply on Is It Possible For Laravel To Have A File Listener?

@Cronix I tried to add it in my AppServiceProvider.php

public function boot()
    {
        $listener = app('watcher')->watch('C:/sample/');

        $listener->anything(function($event, $resource, $path) {
            File::put("C:/sample/sample.txt", "this is a sample file.");
    });
}   

nothing happens

rvabrazaldo left a reply on Is It Possible For Laravel To Have A File Listener?

@Cronix I mean how do I trigger this? in the console route or web route? theres no clear example in the link

rvabrazaldo left a reply on Is It Possible For Laravel To Have A File Listener?

@Cronix Hi thanks for the link, I am still confused how this would run in laravel,

rvabrazaldo started a new conversation Is It Possible For Laravel To Have A File Listener?

I am currently adding new feature to my information system which is SMS.

I already set up the SMS which rely on file system. every file created on the "outgoing" folder will be sent to the recipient. which is easy to implement in laravel.

However, I got one more feature where the client/person will send an SMS back, which will then put in the folder "received".

Now I need laravel to listen to this "received" folder so every time a file is created inside it, I can read it and reply a proper response to the SMS sender.

18 May
1 year ago

rvabrazaldo left a reply on How To Implement Encryption On Data Saves On The Database?

Thanks Bobby,

Now I'm having trouble too in Auth::user() variable as personal information of the user is also encrypted, I always need to decrypt it on the blade template by

{{ decrypt(Auth::user()->name) }}

like that

17 May
1 year ago

rvabrazaldo started a new conversation How To Implement Encryption On Data Saves On The Database?

I'm currently creating a system that collects personal information, and as policy for that I need to encrypt every personal information there is.

I'm not using eloquent, I prefer using this:

DB::select("query string = ?", [$var]);
DB::insert("query string  = ?", [$var]);
DB::update("query string  = ?", [$var]);
DB::delete("query string  =?", [$var]);

I encrypt those in the $var using encrypt($var) on the binding parameter, now, for retrieving those data in the database, whats the best way to DECRYPT those data, is there no other way than looping each result and decrypt it?

04 Dec
1 year ago

rvabrazaldo left a reply on How Can I Get The Api_token In The Authorization Header For Controller To Use?

nvm

Auth::guard('api')->user()

does all of that

rvabrazaldo started a new conversation How Can I Get The Api_token In The Authorization Header For Controller To Use?

I created a logout route for my api, and I need to clear the api_token of the person who has that api token

rvabrazaldo left a reply on Any Idea Why I Can't Get My Cors Working?

i already have api_tokens on my client side, my problem is with the cors.

Laravel Passport is too complicated for what I need. the documentation forces me to add more libraries I don't need. (like vue etc.) I just need something much much simple

rvabrazaldo started a new conversation Any Idea Why I Can't Get My Cors Working?

I've been spending more than 12 hours trying to find why it doesnt work.

here is my API route

Route::middleware(['cors'])->group(function () {

    Route::post('/login', '[email protected]'); <---- the cors middleware works here

    Route::middleware(['auth:api'])->group(function () { <--- anything inside here cors doesn't work

        Route::post('/logout', '[email protected]');
    
        Route::get('/projects', '[email protected]');
    });

});

rvabrazaldo left a reply on Implementing CORS Without Any Packages To Install?

@RamjithAp it doesnt seem to work with any route inside auth:api middleware

rvabrazaldo started a new conversation Implementing CORS Without Any Packages To Install?

I am currently using barryvdh/laravel-cors and for God knows what reason, I can't seem to get it to work.

is there a way to implement cors natively on laravel, I'm surprised laravel haven't included this feature natively.

24 Aug
1 year ago

rvabrazaldo started a new conversation Setting Autoincrement During Migration "sometimes" Doesn't Work

I have a 12 tables which have their own unique auto-increment starting values:

10000000001
20000000001
30000000001
40000000001
50000000001
60000000001
70000000001
81000000001
82000000001
83000000001
84000000001
90000000001

sometimes, the 8xxxxxxxxxx auto-increments won't apply, tables just remain their auto-increment value to "1" whenever I try migration and needed to check each table manually to check it. this peculiar behavior only happens on 8*********** and I don't know the exact reason why it is happening.

my sample migration file

public function up()
{
    Schema::create('tbl_stockreplenishments', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->string('status');
        $table->bigInteger('from');
        $table->bigInteger('to');
        $table->timestamps();
    });

    DB::update("ALTER TABLE `tbl_stockreplenishments` AUTO_INCREMENT = 83000000001;");
}

same format goes to all of the table migration file.

02 Aug
2 years ago

rvabrazaldo started a new conversation Validating Optional Variables In Request Form

I have this validation

    $this->validate($request,[
        'record_id' => 'numeric|required',
        'lot_number.*.*' => 'numeric|required',
        'manufacture_date.*.*' => 'date|required',
        'expiry_date.*.*' => 'date|required',
        'amount.*.*' => 'numeric|required'
    ]);

those multi-dimensional array variables are initially non-existent in the form which are added by clicking an [Add Row] button in the form, its limitless, the user can add as many row as they want.

the validation works if theres at least 1 row existing in the form so that the variables will be pass through the POST method with null values, problem is, if the user submits the form without adding a row, the variables are non-existent, therefor is not included in the POST data.

Adding at least one initial row is not an option.

25 Jul
2 years ago

rvabrazaldo started a new conversation Installing Homestead

I'm using windows 10, i'm very confused what "home" directory the installation guide means

https://laravel.com/docs/5.4/homestead#installing-homestead

"You may install Homestead by simply cloning the repository. Consider cloning the repository into a Homestead folder within your "home" directory, as the Homestead box will serve as the host to all of your Laravel projects:"

rvabrazaldo left a reply on How To Set Up Laravel On My Local Computer For Production

sorry to comeback @Jakub Truneček in your own opinion which one is good for local production?

the set up is like this,

the app will be accessed thru wired local network and online (ip-based url)

09 Jul
2 years ago

rvabrazaldo left a reply on Struggling To Understand The Concepts Of Laravel And Frameworks, Can You Help?

Unification and Standardization.

I'm pretty new to Laravel as well, started using it at work last month so my insight wouldn't be much impactful like the others but these two things I said using a framework is what for.

I haven't even fully using the capability of Laravel (totally ignoring its eloquent active record feature) as I find it not efficient in complex queries but that aside, Laravel as a framework gives more than what a "framework" should provide. Unification of codes is much cleaner and organize, you'll know where you need to put it, you know its there, you know it will work instinctively. the routes just sitting there doing its awesome job. As for standardization, this is very common for us programmers, we always thrive for that beautifully written functions and subroutines that any programmer would understand in a glance, with the application of Laravel MVC, its much easier to write codes efficiently, if you are pretty new to MVC as well, you might check it out too, basically it separate concerns among functions/codes.

Honestly speaking, I'm a guilty developer myself for using plain php for my projects for more than 4 years and hey, it puts food on the table but it needs to stop, its for our own good.

07 Jul
2 years ago

rvabrazaldo started a new conversation How To Set Up Laravel On My Local Computer For Production

currently I run it and use the system I built using laravel through artisan serve command, how can I make laravel live without using those commands, so whenever my computer turns on, the system is live?

15 Jun
2 years ago

rvabrazaldo left a reply on Does Auth::user() Queries The Database Everytime Is It Called/use?

I think I'll just create 3 blade files for my 3 user levels and approach it like this:

@include( 'layouts.nav.' .  Auth::user()->employee->level );
// layouts/nav/admin.blade.php

that way I'm calling the auth::user once per page load rather than calling it every links

rvabrazaldo left a reply on Middleware To Show Items Based On User Roles

@Snapey

yeah, although I fixed it by adding

use Auth;

on my custom middleware

rvabrazaldo started a new conversation Does Auth::user() Queries The Database Everytime Is It Called/use?

I get the user roles by

Auth::user()->employee->level

I manage to set up middleware for checking accesslevels to routes and it was great, now I'm dealing with page navigations, I want to hide page links depending on the user level.

@if(Auth::user()->employee->level == 'Admin')
    <a href="/users/create">Add User</a>
@endif 
@if(Auth::user()->employee->level == 'Admin' || Auth::user()->employee->level == 'Encoder')
    <a href="/users">User Overview</a>
@endif 

Now this works, but for performance sake, I wanna verify if Auth::user()->employee->level requires database access for each item I call it? or is better to store it in a variable so technically I only accesses the database once?

rvabrazaldo left a reply on Middleware To Show Items Based On User Roles

sorry to necro, im having trouble, it says on my custom middleware that Class 'App\Http\Middleware\Auth' not found

30 May
2 years ago

rvabrazaldo started a new conversation Laravel 5.4 Back()->withInput() Not Working

I have a SessionController that handles login auth:

public function store(Request $request)
{
    $this->validate($request,[
        'employee_no' => 'required',
        'password' => 'required'
    ]);

    if(! auth()->attempt(request(['employee_no', 'password']))) {

        return back()->withErrors('Invalid Login Credentials')->withInput();
    }

    return redirect('/');
}

but withInput() is not working

25 May
2 years ago

rvabrazaldo started a new conversation How To Count HasMany Relationship

Hi! I'm new at Laravel and I'm loving it!

I have Users and Groups table which has one to many and many to one relationship eloquently set up-ed.

When I do dd( Groups::with('users')->get() );

I could get the groups and all related users to it, its very cool but this time all I want is the count of users related to the group.