jestins

jestins

Member Since 1 Year Ago

Experience Points 4,030
Experience Level 1

970 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 5
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.

17 Oct
9 months ago

jestins started a new conversation Sharing CSRF Token Between Subdomains

I have set up CORS correctly and set the session domain as .example.com But still when I make an ajax request from www.example.com to app.example.com it throws token mismatch exception. Any help is much apreciated.

NB:

My session domain: .example.com cors allowedOrigins set to [*] cors allowedMethods set to [*] cors allowedHeaders set to [*]

15 Oct
9 months ago

jestins started a new conversation Php Exec With WGET Creating Files

I'm calling exec to run scripts in backgroud using php exec() and wget. But everytime I call this it's creating a file with url parameters in my server. I tried to disable output and tried to store it to a specific file also. Both failed.

here is my code

function execInBackground($cmd)
{
    $cmd = escapeshellcmd($cmd);
    exec($cmd . " > /dev/null &");
}

And I'm calling it like below

execInBackground('wget -q http://example.com/d/do-processing?process=501&res=201');

So now it will create a file named

do-processing?process=501&res=201

in my server. Can you guys please mention is there anything I missed while doing this.

I want to call that url in background without saving any output. In worst case I need to store the output of each call to a specific file instead of creating multiple files.

exec($cmd . " > process.out 2> process.err < /dev/null &");

I tried like above code and didn't worked.

10 Aug
11 months ago

jestins started a new conversation Issue With Linking CNAME In Laravel With Wildcard Subdomains

I'm trying to make a laravel app that people can sign up to my Laravel app and then a subdomain will be created dynamically for each user.

Route::group([
                'domain' => {account}.mylaravelapp.com',
                'middleware' => 'Authorize'
            ], function () {
            
                Route::get('/', function ($account) {
                    return $account;
                });
            });

So if a user register an account and set the account name as test then they will have a subdomain created at test.mylaravelapp.com. This subdomain returns a view with data related to their account.

I'd like to give users the ability to mirror their site at test.mylaravelapp.com to their own domain address. I tried to mirror by updating the CNAME record to test.mylaravelapp.com for my domain and A record to the test.mylaravelapp.com Ip address, however it doesn't seem to work :( .

It's always redirecting me to default webpage.cgi

test.com/cgi-sys/defaultwebpage.cgi

So now I'm left wondering how I can point requests in the right direction when they land on my app. So for example if traffic hits random.com and it has an A record that is equal to my servers IP, plus a CNAME of test.mylaravelapp.com, then how do I handle the request and redirect it to the correct subdomain whilst keeping the user on their custom domain?

Thanks, Jestin

11 Apr
1 year ago

jestins left a reply on Issue With Mix Install On Centos 6

Any idea guys.?

jestins left a reply on Issue With Mix Install On Centos 6

I can't run it from root user since it's running from deploybot(Auto deploy). I need to know is it possible to overwrite the permission for this user.

jestins started a new conversation Issue With Mix Install On Centos 6

Once I finished in my local(Windows) everything is working as expected, but when I try to do npm install in the server with non-root user it's throwing this error.

    at Promise.all.then.arr (/home/***/node_modules/pngquant-bin/node_modules/bin-build/node_modules/execa/index.js:231:11)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:118:7)

If I run the same with root user it works.

Anyone knows the issue.?

08 Mar
1 year ago

jestins left a reply on Laravel RedirectIfAuthenticated Middleware

I fixed by avoiding middle-ware for the rest of the routes.

jestins started a new conversation Laravel RedirectIfAuthenticated Middleware

I want to redirect users only from login and registration page, Rest they can browse, How can I do that?

02 Mar
1 year ago

jestins left a reply on Pagination Issue In Laravel 5.3

I fixed the issue, Issue is with config cache:

php artisan config:cache fixed the issue

Hope it helps for some one.

jestins started a new conversation Pagination Issue In Laravel 5.3

When I try to render pagination getting this error.

call_user_func() expects parameter 1 to be a valid callback, no array or string given (View: C:\xampp\htdocs\project\resources\views\pages\app\file.blade.php) (View: C:\xampp\htdocs\project\resources\views\pages\app\file.blade.php) (View: C:\xampp\htdocs\project\resources\views\pages\app\file.blade.php)```

Here is my code

```$items = $this->repo->getData();
        if(empty($items)){
            return [];
        }
        $options['path'] = route('test');
        $options['query'] = ['id' => 5];
        $page = $page ?: (Paginator::resolveCurrentPage() ?: 1);
        $items = $items instanceof Collection ? $items : Collection::make($items);
        return new LengthAwarePaginator($items->forPage($page, $perPage), $items->count(), $perPage, $page, $options);```
26 Feb
1 year ago

jestins started a new conversation Laravel 5.3 Auth Facade Issue

How to use Auth::check(); inside a service(Not in controller) in laravel 5.3?

23 Feb
1 year ago

jestins left a reply on Laravel 5.3 Memory Leak

Is there in difference in Formrequest from 5.2 to 5.3?

jestins started a new conversation Laravel 5.3 Memory Leak

I'm trying to upgrade 5.2 to 5.3 and I've made a request class in Laravel 5.3. Looks like this:

<?php namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class LoginFormRequest extends FormRequest
{
    // Check if the user is authorized to make this request.
    public function authorize()
    {
        // Here we can check for user-campaign mapping validation and return true or false. Also access level validation
        return true;
    }

    // Define all the validation rules that the form has to get validated.
    public function rules()
    {
        return [
            'email' => 'required|email|max:254',
            'password' => 'required|min:6|max:18',
            'remember_me' => ''
        ];
    }

}

But when I use this request in my controller I receive 500 error and apache log it's shows like this.When I remove the rules in the request, Everything works fine. Anyone have any idea about this issue.?

[Fri Feb 23 12:37:58.778529 2018] [ssl:warn] [pid 3232:tid 616] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Feb 23 12:38:00.061738 2018] [core:warn] [pid 3232:tid 616] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Fri Feb 23 12:38:00.261861 2018] [ssl:warn] [pid 3232:tid 616] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Feb 23 12:38:00.299888 2018] [mpm_winnt:notice] [pid 3232:tid 616] AH00455: Apache/2.4.26 (Win32) OpenSSL/1.0.2l PHP/7.1.7 configured -- resuming normal operations
[Fri Feb 23 12:38:00.299888 2018] [mpm_winnt:notice] [pid 3232:tid 616] AH00456: Apache Lounge VC14 Server built: Jun 15 2017 12:39:41
[Fri Feb 23 12:38:00.299888 2018] [core:notice] [pid 3232:tid 616] AH00094: Command line: 'c:\xampp\apache\bin\httpd.exe -d C:/xampp/apache'
[Fri Feb 23 12:38:00.877678 2018] [mpm_winnt:notice] [pid 3232:tid 616] AH00418: Parent: Created child process 17444
[Fri Feb 23 12:38:02.298467 2018] [ssl:warn] [pid 17444:tid 656] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Feb 23 12:38:02.905425 2018] [ssl:warn] [pid 17444:tid 656] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Feb 23 12:38:02.953462 2018] [mpm_winnt:notice] [pid 17444:tid 656] AH00354: Child: Starting 150 worker threads.

VirtualAlloc() failed: [0x00000008] Not enough storage is available to process this command.


VirtualFree() failed: [0x000001e7] Attempt to access invalid address.


VirtualAlloc() failed: [0x00000008] Not enough storage is available to process this command.


VirtualFree() failed: [0x000001e7] Attempt to access invalid address.

[Fri Feb 23 12:38:05.493213 2018] [php7:error] [pid 17444:tid 2008] [client 127.0.0.1:62378] PHP Fatal error:  Out of memory (allocated 1692401664) (tried to allocate 262144 bytes) in C:\xampp\htdocs\project-new\vendor\laravel\framework\src\Illuminate\Validation\Validator.php on line 456, referer: http://www.project.org/login.php

VirtualAlloc() failed: [0x00000008] Not enough storage is available to process this command.


VirtualFree() failed: [0x000001e7] Attempt to access invalid address.

[Fri Feb 23 12:38:05.495214 2018] [php7:error] [pid 17444:tid 2008] [client 127.0.0.1:62378] PHP Fatal error:  Out of memory (allocated 1692401664) (tried to allocate 262144 bytes) in C:\xampp\htdocs\project-new\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php on line 144, referer: http://www.project.org/login.php

I tried to increase PHP memory limit no use, and no solution I found in web. Can anybody help with the same.?

jestins left a reply on Laravel 5.3 Throws 500 Error Formrequest

[Fri Feb 23 12:37:58.778529 2018] [ssl:warn] [pid 3232:tid 616] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Feb 23 12:38:00.061738 2018] [core:warn] [pid 3232:tid 616] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Fri Feb 23 12:38:00.261861 2018] [ssl:warn] [pid 3232:tid 616] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Feb 23 12:38:00.299888 2018] [mpm_winnt:notice] [pid 3232:tid 616] AH00455: Apache/2.4.26 (Win32) OpenSSL/1.0.2l PHP/7.1.7 configured -- resuming normal operations
[Fri Feb 23 12:38:00.299888 2018] [mpm_winnt:notice] [pid 3232:tid 616] AH00456: Apache Lounge VC14 Server built: Jun 15 2017 12:39:41
[Fri Feb 23 12:38:00.299888 2018] [core:notice] [pid 3232:tid 616] AH00094: Command line: 'c:\xampp\apache\bin\httpd.exe -d C:/xampp/apache'
[Fri Feb 23 12:38:00.877678 2018] [mpm_winnt:notice] [pid 3232:tid 616] AH00418: Parent: Created child process 17444
[Fri Feb 23 12:38:02.298467 2018] [ssl:warn] [pid 17444:tid 656] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Feb 23 12:38:02.905425 2018] [ssl:warn] [pid 17444:tid 656] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Feb 23 12:38:02.953462 2018] [mpm_winnt:notice] [pid 17444:tid 656] AH00354: Child: Starting 150 worker threads.

VirtualAlloc() failed: [0x00000008] Not enough storage is available to process this command.


VirtualFree() failed: [0x000001e7] Attempt to access invalid address.


VirtualAlloc() failed: [0x00000008] Not enough storage is available to process this command.


VirtualFree() failed: [0x000001e7] Attempt to access invalid address.

[Fri Feb 23 12:38:05.493213 2018] [php7:error] [pid 17444:tid 2008] [client 127.0.0.1:62378] PHP Fatal error:  Out of memory (allocated 1692401664) (tried to allocate 262144 bytes) in C:\xampp\htdocs\mondovoio-new\vendor\laravel\framework\src\Illuminate\Validation\Validator.php on line 456, referer: http://www.mondovo.org/login.php

VirtualAlloc() failed: [0x00000008] Not enough storage is available to process this command.


VirtualFree() failed: [0x000001e7] Attempt to access invalid address.

[Fri Feb 23 12:38:05.495214 2018] [php7:error] [pid 17444:tid 2008] [client 127.0.0.1:62378] PHP Fatal error:  Out of memory (allocated 1692401664) (tried to allocate 262144 bytes) in C:\xampp\htdocs\mondovoio-new\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php on line 144, referer: http://www.mondovo.org/login.php
22 Feb
1 year ago

jestins left a reply on Laravel 5.3 Throws 500 Error Formrequest

No error in the log. :(

jestins started a new conversation Laravel 5.3 Throws 500 Error Formrequest

I'm trying to upgrade 5.2 to 5.3 and I've made a request class in Laravel 5.3. Looks like this:

<?php namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class LoginFormRequest extends FormRequest
{
    // Check if the user is authorized to make this request.
    public function authorize()
    {
        // Here we can check for user-campaign mapping validation and return true or false. Also access level validation
        return true;
    }
    
    // Define all the validation rules that the form has to get validated.
    public function rules()
    {
        return [
            'email' => 'required|email|max:254',
            'password' => 'required|min:6|max:18',
            'remember_me' => ''
        ];
    }

}

But when I use that in my controller I receive:

500 internel server status without any response, When I remove the rules in the request, Everything works fine.

02 Feb
1 year ago

jestins left a reply on Laravel5.5 Error After Merging Branch: Failed Opening Required File

Looks like directory config issue of the plugin. removing vendor dir and composer install may work

23 Jan
1 year ago

jestins left a reply on MethodNotAllowedHttpException

Route::any

give any and try, It'll work in your case. :)

jestins left a reply on DOM Document Help

It's for a scraping project. So I'm doing like this. :)

jestins started a new conversation DOM Document Help

Can you guys please help me to get all the paragraph inside body of a DOM document. I tried something like this, it didn't worked.

$document->getElementsByTagName( 'body' )->getElementsByTagName('p');

16 Jan
1 year ago

jestins left a reply on Error In Array In View File

@arslan2037 show me the $json['user']['media'] items

jestins left a reply on LAravel SQL Optimization (Query, Cache, Etc)

Can you try query builder instead of Eloquent.? and make sure if any join is thr then both table should be indexed. and paste your EXPLAIN query result here

15 Jan
1 year ago

jestins left a reply on Error In Array In View File

@arslan2037 try what I suggested

jestins left a reply on Image Doesn't Appear How Can I Update It

public function update(Request $request,Partner $partner )
    {
        $file = $request->file('image'); //I hope you image field name is "image" only.

        
    }

jestins left a reply on Laravel5 And Bootstrap-select

<title>SROKA</title>

<!-- META TAGs -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="favicon.ico">

<!-- CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">

@yield('css')

@include('layouts.nav')

<div class="container">
    @if(session('message'))
    <div class="alert alert-success alert-dismissible" role="alert">
        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
            <span aria-hidden="true">&times;</span>
        </button>
        {{@session('message')}}
    </div>
    @endif

    @yield('header')
    @yield('content')
</div>

<!-- Scripts -->
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.2/js/i18n/defaults-*.min.js"></script>
<!--
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.0/js/bootstrap-datepicker.min.js"></script>
-->

<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<!-- <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script> -->

@yield('scripts')
<script type="text/javascript">
    $('.selectpicker').selectpicker('render');
</script>

jestins left a reply on Laravel5 And Bootstrap-select

I think Jquery is missing in your blade.

Check the browser console and post here if some errors are there.

jestins left a reply on Laravel Can't Update Data When Using SQL Server Database On Ubuntu

It's look like carbon createFromFormat error, If your date string is "shorter" than the format that time this kind of error arise. Not related to DB

jestins left a reply on Error In Array In View File

@if(isset($json['user']['media']['nodes']))
@foreach($json['user']['media']['nodes'])
{{$node['index']}}
@endforeach 
@endif 

Try this.

jestins left a reply on Laravel Can't Update Data When Using SQL Server Database On Ubuntu

Are you using carbon's createFromFormat ?

jestins left a reply on Is It Safe To Querying Database In Middle Ware Which Is Assigned To All Routes In Web?

There is no issue by doing that, But better once user is authorized you can set some flag in session, and you can use that flag for the same purpose. :)

jestins left a reply on LAravel SQL Optimization (Query, Cache, Etc)

@chireen I'm working in a project that contain more than 500cr data in a table and it's works fine. Only thing you need to check is how optimized your table is. you should index the columns that you need to check.

Once the table is optimized I prefer query builder over Eloquent( I felt query builder is faster from my experience). And try to do an "EXPLAIN" operation to check what causing the query to take much time. Mostly "GROUP BY" and "ORDER BY" will slow down the query. In this case I suggest you to get the result and do the rest operations in PHP. it'll save your 90% time. :)

jestins left a reply on Laravel 5.2 To 5.5 Upgrade

Ok thanks, I'll try myself. :)

14 Jan
1 year ago

jestins started a new conversation Laravel 5.2 To 5.5 Upgrade

Hi guys,

I'm working on a big project and it's on 5.2, Now I'm planning to migrate to v5.5. Is it risky or easy to migrate.? And all v5.2 functionalities will work on v5.5..?

10 Oct
1 year ago

jestins started a new conversation Bulk Update In MongoDB

Is it possible to update in mongodb with case condition like mysql.?

04 Oct
1 year ago

jestins left a reply on Use Blade In External JS File

In js file you can't do that.

You can set some global variable in the blade file based on your condition and use that variable instead.

13 Sep
1 year ago

jestins left a reply on MongoDb: Dynamic Table Creation

Anybody knows. ?

12 Sep
1 year ago

jestins started a new conversation MongoDb: Dynamic Table Creation

I want to create different table(collection) based on user inputs(custom fields) in mongoDB, I'm using jenssegers/laravel-mongodb package.

For eg:

For user 1 
"db.test.user_1_data.insert(
{
   '_id':[user_id],
   'First Name':'Abc',
   'Last Name':'Srf',
   'Email':'[email protected]',
   'note':'foo',
   'something':'okokok'
})" 

For user 2
     
"db.test.user_2_data.insert(
{
   '_id':[user_id],
   'First Name':'Rst',
   'Last Name':'Unw',
   'Email':'[email protected]',
   'some_extra_field':'foo',
   'user_own_fields':'okokok',
   'user_again':'dddd'
})" 
    ```

Like above example multiple users will come with multiple fields.. How can I create and index this dynamically based on user inputs.?
    
    
    
    
    
    


09 Aug
1 year ago

jestins left a reply on Package Development On Laravel 5.4

Run this command and try again

alias 'php={your php path}/bin/php'

jestins left a reply on Base Table Or View Not Found: 1051 Unknown Table After Php Artisan Migrate:refresh

Follow these steps:

1: truncate migrations table. 2: Drop all the migration tables. 3: run php artisan migrate

jestins left a reply on Like Operator In Laravel Blade

                                            
        //if $k is similar to update, then $td_class = 'update'
                                               
                  @if ($k == 'update')
                           $td_class = 'update'
           @elseif 
                    $td_class = ''
                                                 
                    @endif
                        <tr>
                               <td class="{{ $td_class }}">{{$in}}</td>
                         </tr>
    @endforeach```

Hope this will fix your problem

jestins left a reply on Package Development On Laravel 5.4

Did you installed multiple php packages.? Then make default php as 7.0

08 Aug
1 year ago

jestins left a reply on Make A Option Group Select With Collection

option_type = [];
foreach($doc['option_type'] as $data){
$option_type[$data->category_slug] = $data->option;
}
$final[] = $option_type;