skeith22

Web Developer at HYBrain Development Corporation

Experience

4,540

0 Best Reply Awards

  • Member Since 4 Months Ago
  • 40 Lessons Completed
  • 0 Favorites

3rd November, 2017

skeith22 left a reply on How To Cast Arrays Into Object Dynamically By Using (object) Casting In The Blade Views • 3 weeks ago

Nevermind guys I just found out you can return it with casting (object)

skeith22 started a new conversation How To Cast Arrays Into Object Dynamically By Using (object) Casting In The Blade Views • 3 weeks ago

Does anyone know how to cast an array to object dynamically?

I have an array of arrays that I want to cast into object automatically on the blade views.

so it can be an array of objects.

let's just say $users is one

doing

foreach($users as $user) {
    $user = (object) $user;
    echo $user->id;
}

does the trick, but I'm wandering if its possible to do like

foreach($users as (object) $user) {
    $user = (object) $user;
    echo $user->id;
}

ofcourse this causes an error. I wanted to the code above in the blade views

currently I'm doing this because my value is an array. I'm using transform collection method incase you're wandering why it is in array.

@forelse ($users as $user)
{{ $user['id'] }}
@endforeach

I wanted to cast it on object on the blade views, so I can do this instead

@forelse ($users as $user)
{{ $user->id }}
@endforeach 

ofcourse I could just do this

<?php $user = (object) $user ?>

but its quite dirty to look at.

22nd October, 2017

skeith22 started a new conversation Laravel Horizon Package Needs Pcntl Extension On Windows • 1 month ago

Has anyone tried installing the horizon package on windows?

does this parameter work? --ignore-platform-reqs

18th October, 2017

skeith22 started a new conversation How To Manually Query The Soft Deleted Data • 1 month ago

The model is using SoftDeletes trait.

Does anyone know how to manually query the deleted files?

I wanted to query the deleted data without using the withTrashed() or onlyTrashed() functions

13th October, 2017

skeith22 left a reply on How To Override The Functionality Of A Certain Core Class. • 1 month ago

Hi @Screenbeetle,

Yes2 I'm aware of how to override methods. The method is not in the trait which is I don't know how they trigger it, as of the moment I literally commented out the core code, and wrote my own logic on it hahahah IT A REALLY BAD IDEA, though it works like magic hahahahaha.

skeith22 started a new conversation How To Override The Functionality Of A Certain Core Class. • 1 month ago

Does anyone know how to override this without actually touching the core file itself

vendor\laravel\framework\src\Illuminate\Auth\Notifications\ResetPassword.php

line 39-51

/**
 * Build the mail representation of the notification.
 *
 * @param  mixed  $notifiable
 * @return \Illuminate\Notifications\Messages\MailMessage
 */
public function toMail($notifiable)
{
    return (new MailMessage)
        ->line('You are receiving this email because we received a password reset request for 
        your account.')
        ->action('Reset Password', url(config('app.url').route('password.reset', $this->token, 
        false)))
        ->line('If you did not request a password reset, no further action is required.');
}

cause I have a sub-domain that also uses password reset functionality, and I also change the default names of Auth:routes().

so the password.reset is now show-reset-form.

anyone have an idea?

skeith22 left a reply on Laravel New App-name Curl Error 6. This Should Not Happen. • 1 month ago

@ChristophHarms Thanks for the reply man! :D

2nd October, 2017

skeith22 left a reply on Laravel New App-name Curl Error 6. This Should Not Happen. • 1 month ago

@Yamen hi yamen, I turned off the internet intentionally to test if the installer would run without internet. it should work without internet. it should cause that's what it does before. it should just load it from cache.

and I know it checks for the latest live versions, but then again it should just load the cache if there is no internet but instead it spits out error, that's the purpose of the installer to install the latest cache if there is not internet.

1st October, 2017

skeith22 started a new conversation Laravel New App-name Curl Error 6 When No Internet Connection. • 1 month ago

laravel installer version is 1.4

I'm getting an error when using the laravel new command

cURL error 6: Could not resolve host: cabinet.laravel.com (see 
http://curl.haxx.se/libcurl/c/libcurl-errors.html)

22nd August, 2017

skeith22 started a new conversation Apache2 Cannot Remove Index.php In Mozilla Firefox Even With Mod_rewrite Enabled • 3 months ago

does anyone how to fix this error? I have enabled the mod_rewrite in apache2 and added AllowOverride All in my vhost.

it works normally on Google Chrome but Mozilla Firefox doesn't remove the index.php

4th August, 2017

skeith22 left a reply on Where Between In Query Builder Using Date Values Is Not Working As Expected. • 3 months ago

Nevermind guys I found the answer I just needed to add

->toDateTimeString():

skeith22 started a new conversation Where Between In Query Builder Is Not Working As Expected. • 3 months ago

I'm trying to get the data between 2 dates.

and this code returns 0 results

return Model::whereBetween('created_at', [$this->carbon->startOfWeek(), $this->carbon->endOfWeek()])->get();

this is the query statement it creates when I use toSql();

select * table where created_at between ? and ?

but this query works

return $this->appointment->whereRaw('`created_at` between "' . $this->carbon->startOfWeek() . '" and "' . $this->carbon->endOfWeek() . '"')->get();

I don't get why the first one doesn't work but doing whereRaw works but they have the same query statement.

is this a bug?

31st July, 2017

skeith22 left a reply on Why Storage Class Doesn't Have A Storage() Helper Function ITS A NEED!! :D • 3 months ago

@jlrdw thanks for the reply I already found the solution for it.

26th July, 2017

skeith22 left a reply on How Do I Get All Users With Roles Where Role = 'admin' Using Eloquent Along With Entrust? • 3 months ago

This is the answer

User::whereHas('roles', function ($query) {
$query->where('id', 1);
});

17th July, 2017

skeith22 left a reply on Why Storage Class Doesn't Have A Storage() Helper Function ITS A NEED!! :D • 4 months ago

@Snapey hmmm..let me see I'll try again using the asset() helper.

but Storage::url() clearly goes with using the

request()->picture->store('public/your_folder');

or

request()->image->store('public/your_folder');

or

request()->photo->store('public/your_folder');

15th July, 2017

skeith22 left a reply on Why Storage Class Doesn't Have A Storage() Helper Function ITS A NEED!! :D • 4 months ago

@Snapey the url for you to display it on the view.

skeith22 started a new conversation Why Storage Class Doesn't Have A Storage() Helper Function • 4 months ago

I'm lately creating a project that involves uploading a lot of files and displaying them specially images.

its kinda bothersome that you need to include

use Illuminate\Support\Facades\Storage

in almost all of your controllers cause you need the function

Storage::url()

for you to display images in your view instead of if we have

storage()->url()

we don't need to include

use Illuminate\Support\Facades\Storage

we could just use the storage() helper function in the views to pull files in the Storage

Edit Your Profile
Update

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