prasadchinwal5

prasadchinwal5

Application Developer at University Of Illinois

Member Since 1 Year Ago

Experience Points
107,260
Total
Experience

2,740 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
1025
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.

Level 22
107,260 XP
Feb
14
1 week ago
Activity icon

Awarded Best Reply on Laravel Telescope Keeps Scanning

@pamtoffel @bagwaa @aritzcovan @robertbar

Finally a solution

This happens because I was run all my apps on a subdomain.

My Fix:

  • Follow all Laravel Telescope installation steps.
  • publish Telescope assets php artisan telescope:publish
  • Add MIX_APP_NAME to your .env file. E.g. My domain is apps.org.edu and my subdomain is the app_name e.g. studentRecords So my MIX_APP_NAME will be studentRecords
  • Run mkdir -p resources/views/vendor/telescope
  • Run cp vendor/laravel/telescope/resources/views/layout.blade.php resources/views/vendor/telescope/
  • Edit the resources/views/vendor/telescope/layout.blade.php file.
  • Replace the telescope path in the script tags at the bottom of the page. window.Telescope.path = '{{ env('MIX_APP_NAME') }}/telescope';
Activity icon

Replied to Laravel Telescope Keeps Scanning

@pamtoffel @bagwaa @aritzcovan @robertbar

Finally a solution

This happens because I was run all my apps on a subdomain.

My Fix:

  • Follow all Laravel Telescope installation steps.
  • publish Telescope assets php artisan telescope:publish
  • Add MIX_APP_NAME to your .env file. E.g. My domain is apps.org.edu and my subdomain is the app_name e.g. studentRecords So my MIX_APP_NAME will be studentRecords
  • Run mkdir -p resources/views/vendor/telescope
  • Run cp vendor/laravel/telescope/resources/views/layout.blade.php resources/views/vendor/telescope/
  • Edit the resources/views/vendor/telescope/layout.blade.php file.
  • Replace the telescope path in the script tags at the bottom of the page. window.Telescope.path = '{{ env('MIX_APP_NAME') }}/telescope';
Activity icon

Started a new Conversation Testing Views

Hi everyone,

So I have an application built in Laravel and it uses Oracle as database. I see that many Models in the laravel app point to database views created in Oracle.

I checked the DDL for the views and it so happens that these views are created by referencing the app schema plus some other schema created in the organization.

My question is how do I make use of these views via eloquent models and write my tests.

If you have Examples or links to some articles/videos please share. Your help is highly appreciated.

Prasad

Feb
13
1 week ago
Activity icon

Replied to How To Access Json Column In Laravel

@adeguntoro what does {{ $website->meta['gender'] }} gives you?

Activity icon

Replied to Ajax Search

@aronaman what response do you send from your controller action?

Activity icon

Replied to Call Controller Method In Javascript

@bikashkatwal I see. In that case you might consider using an ajax request (axios library works best in my opinion). This would help you send request, perform actions(Store in db etc ) and retrieve response.

Activity icon

Replied to Call Controller Method In Javascript

@bikashkatwal All you have to do is define the method and action on the form tag.

Ex.

<form action="/route_to_your_controller_action" method="POST/GET">
<!-- Also do not forget to add your csrf_token -->
@csrf
<button type="submit" class="next small-12 right">Confirm</button>
</form>
Jan
29
3 weeks ago
Activity icon

Replied to Hosted Laravel Application Doesn't Fully Display Pages

@besoinre Did you point your web server document root to the public folder? It can be one of the reasons. Not sure if it is in this case?

Does the page load correctly when you visit your app ?

Activity icon

Replied to Laravel PDOStatement::execute(): MySQL Server Has Gone Away Error When Inserting Data Using Curl Request

@vincentsanity Can you dump what $trimmed contains?

Or also try moving the DB::insert statement inside this loop

foreach ($trimmed as $data){
    $inserts[] = ...
    
\DB::table('property_site_plan')->insert($inserts);

}

Activity icon

Replied to Laravel Comparing Model Table Date With Relation Table Date

@jawe031 I believe you would have to extract the where clause to a method.

public function entry_goods() {
 return $this->hasMany('App\EntryAccessionGood', 'norm_id', 'norm_id'); 
}

and then another method which would be like

public function myfilter()
{
    return $this->entry_goods()->whereRaw('entry_accession_goods.created_at <= exit_accession_goods.created_at');
}

Then you can get your results like

$model = Mymodel::find(1);
$model->myfilter()->get();
Jan
22
4 weeks ago
Activity icon

Replied to Vuetify Datatable Filtered Items.

@rameezisrar Thanks for the reply. I am using the default filters from [email protected] My problem is with retrieving the filtered data after the filter has been applied.

The Example in my CodePen is actually from Vuetify docs. I just showed how the event current-items returns only page 1 items and not all filtered items.

Thanks.

Activity icon

Started a new Conversation Vuetify Datatable Filtered Items.

Hi,

I have a vuetify databale which has a filter. I need to retrieve all the items in the datatable after the filter has been applied. What is the best way this can be achieved?

What I have tried? I have tried using the event current-items in vuetify datatable. The issue is it works only for items displayed on current page. When I get results which are more than 1 page this does not work.

Here is my Pen: My Pen.

Thanks in advance.

Jan
19
1 month ago
Activity icon

Replied to Upload Image On Responsive Website

@richardgarcia Could you please give specifics about the error you get? If it works on web I don't think there should be a problem with responsive mode.

Activity icon

Replied to Yajra/laravel-datatables Slowdown Issue

@phoenix5 Not sure if this will help but try adding the action column in your controller rather than in the javascript part.

return Datatables::of($Users)
            ->addColumn('action', function ($Users) {
                return '<a href="users/' . $Users->id . '/edit" class="btn btn-block btn-warning">Edit</a>';
            })->make(true);

Also if this does not work, it might be issue with your query itself. Try noticing how long does your query take to execute and if you have any n+1 issues.

Best, Prasad

Activity icon

Replied to Uploaded Images Works On Localhost But Broken On Live Server

@kingsleyo do you see your images on the server? Also check user permissions on your server. chmod 777 to you storage directory might help.

Activity icon

Replied to Show Annual Charges After One Year.

@robert_wlliams Could you please explain the issue in depth? Or maybe explain what you have achieved so far and maybe I can help.

Thanks.

Jan
13
1 month ago
Activity icon

Replied to How To Check Same Set Of Permissions Assigned To Another Role?

@afrasiyabhaider You could do something like this.

$roleA = Role::where('name', 'roleA')->first();
$roleB = Role::where('name', 'roleB')->first();

$roleAPermissions = $roleA->permissions;
$roleBPermissions = $roleB->permissions;

$diff = $roleAPermissions->diff($roleBPermissions);

Now you can check if diff is empty then they have same permissions else not.

** P.S. This code is not tested. I have referred the code on Github though. **

Hope it helps.

Thanks, Prasad

Activity icon

Replied to Managing Multiple Ajax Calls On Single Page View

@vincej I am not sure how updated my knowledge is but I usually end up using Laravel Api resources and pass whatever data I need from the controller.

Having said that from my learning it is always best to separate your controllers and not have logic to get resources from single controller.

Now about the multiple ajax calls you could call the ajax methods in your mounted/created methods if you are using VUEJS or declare them in onPageLoad. It would be always beneficial to call these methods as async.

Thanks, Prasad Chinwal

Activity icon

Awarded Best Reply on Laravel For Vue And Flutter Apps

@algil Every application is in its own folder. Each one of our application is served on a subdomain. Ex. https://apps.org.com/appname/api/version1/endpoint where appname is substituted. I would not recommend the setup it can become difficult to run some additional packages.

We faced problems integrating our apps with Laravel Telescope and Laravel Passport.

This approach is complex and frankly unnecessary. But it was the teams decision and we went ahead with this. But let me be frank it is much easier to maintain. 100%.

Thanks, Prasad Chinwal

Jan
12
1 month ago
Activity icon

Replied to Laravel For Vue And Flutter Apps

@algil Every application is in its own folder. Each one of our application is served on a subdomain. Ex. https://apps.org.com/appname/api/version1/endpoint where appname is substituted. I would not recommend the setup it can become difficult to run some additional packages.

We faced problems integrating our apps with Laravel Telescope and Laravel Passport.

This approach is complex and frankly unnecessary. But it was the teams decision and we went ahead with this. But let me be frank it is much easier to maintain. 100%.

Thanks, Prasad Chinwal

Jan
11
1 month ago
Activity icon

Replied to Laravel For Vue And Flutter Apps

Hi @algil, I am not sure how extensive your application is going to be but my team uses Laravel as backend serving API's required for our NUXT and Flutter apps. We currently use Laravel Passport for authentication but day before yesterday Taylor released a beta version of Laravel Airlock which we plan to use once it is released.

Jan
09
1 month ago
Activity icon

Awarded Best Reply on How To Make A Datatable Together With Daterangepicker+search-input? Ajax Server Side? How??

@hericles I have tried doing this and let me tell you after spending almost 15 - 20 days I realized it is not worth it. I just ended up converting my app to VueJS and using Vuetify for my datatable.

Highly Customizable and easy to use.

Jan
06
1 month ago
Activity icon

Replied to How To Make A Datatable Together With Daterangepicker+search-input? Ajax Server Side? How??

@hericles I have not used any Vue admin templates yet but all my colleagues speak highly about Creative Tim.

Jan
05
1 month ago
Activity icon

Awarded Best Reply on Display Only One Item From Array At Once

@hjortur17

I am not sure if this will work. But please give this a try. P.S. Not tried

  1. Set initial index for the for loop to 1.
  2. Remove the v-for loop.
  3. Display the 1st recipe as recipes[index] and recipe property as recipes[index].title etc.
  4. Add a Next Recipe button and add a @click="index++"
Activity icon

Replied to Register/login Flow With Passport In REST API

@petrogromovo Forgive me if I am wrong but I may have misunderstood the above comment.

The oauth_clients table would only store the values related to the client, in this case the Laravel application serving the API's.

The users have no role whatsoever to play in this. All users would have same client_id as they would be requesting resource from same client(Laravel App).

Jan
04
1 month ago
Activity icon

Replied to Nuxt-link Not Working Root Url(to="/")

@tislam Are you using a layout? and if yes in your layout are you explicitly setting <nuxt/>?

Activity icon

Replied to Detect User Current City And State Laravel Solution?

@mubeenali Okay i know the solution I am proposing is paid but you said you dont want to use Google MAPS API.

So try this package IPInfo

Activity icon

Replied to How To Make A Datatable Together With Daterangepicker+search-input? Ajax Server Side? How??

@hericles I have tried doing this and let me tell you after spending almost 15 - 20 days I realized it is not worth it. I just ended up converting my app to VueJS and using Vuetify for my datatable.

Highly Customizable and easy to use.

Activity icon

Replied to Register/login Flow With Passport In REST API

@petrogromovo Run this command php php artisan passport:install and it will generate the client_id and client-secret for you.

Activity icon

Replied to Display Only One Item From Array At Once

@hjortur17

I am not sure if this will work. But please give this a try. P.S. Not tried

  1. Set initial index for the for loop to 1.
  2. Remove the v-for loop.
  3. Display the 1st recipe as recipes[index] and recipe property as recipes[index].title etc.
  4. Add a Next Recipe button and add a @click="index++"
Activity icon

Replied to Laravel Valet 404 - Not Found

@amidknight Can you try running php valet link app_name ? Thanks.

Jan
02
1 month ago
Activity icon

Commented on Refactoring To Lookup Tables

@calebporzio The lesson was amazing.

Quick question.

How would you handle if a user has multiple roles using lookup tables?

Ex. A user has a role of author and also an admin. where would you redirect the user to?

Dec
29
1 month ago
Activity icon

Replied to Logout

@mehmetanbaki Can you run this command and post the results php artisan route:list?

Activity icon

Replied to Multi Auth Tutorial Recommendations

@whoisthisstud Your requirements are kind of norm these days.

Luckily there are so many packages you can choose from.

This would be the first step.

Next, you need to have a method on your User model which basically returns the role of user i.e. admin/superadmin/user etc.

Now after authenticating the user you can check and redirect the user based on their role using lookup table.

Ex.

$destinations = [
    'admin' => '/admin',
    'superadmin' => '/superadmin',
    'user' => '/user',
];

return redirect($destinations[$user->type]);

This approach is taught by caleb porzio on this tutorial

Activity icon

Replied to User Wise Redirect After Login Using Laratrust

@elamine12 I have done this using lookup table. Ex.

After authentication user in your Homecontroller or Custom controller check the user permissions and redirect based on role.


$destinations = [
    'admin' => '/admin',
    'employee' => '/employee'
];

return redirect($detinations[$user->type]);

and in your User model have a type attribute which returns the 'admin' if user has admin role or 'employee' if user has employee role.

Source: @calebporzio

Activity icon

Replied to Logout

@mehmetanbaki

  • What version of Laravel are you using?
  • What does your logout route look like in php routes/web.php file?

Thanks!

Activity icon

Replied to Authorization Header Value Being Masked

@seongbae Ok please bear with me, I know you must have followed the documentation to the point but could confirm that these steps are in place?

  • The users model uses the HasApiTokens trait.
  • You have passport routes in your AuthServiceProvider as php Passport::routes();
  • You have set your api driver to passport in php config/auth.php file.

Reference to passport docs:

Thanks!

Activity icon

Replied to Laravel DB Not Found.

As @tisuchi commented import the DB class in your controller.

use DB;

Thanks!

Activity icon

Replied to GalleryList Vue

@davy_yg Just try doing this

let currentParam = `per_page=` + this.number

and accept the prop number in your vue component.

Activity icon

Replied to Laravel Update Method Is Not Working

@brad_fresh99 Could you please rewrite the blade code to this:

{{ Form::model($post, array('route' => array('post.update', $post->id), 'method' => 'PUT')) }}

Or Please try adding method => 'PUT' to your existing code.

Thanks!

Activity icon

Awarded Best Reply on Stream_socket_sendto(): Connection Refused

@devfrey thanks for taking out the time to comment. I fixed the issue with chmod 777 for storage/app/public directory.

Nov
21
3 months ago
Activity icon

Replied to Shibboleth Authentication

@konrms I would be happy to help you out. Please send me a message on twitter https://twitter.com/PrasadChinwal1

Nov
20
3 months ago
Activity icon

Replied to Shibboleth Authentication

@konrms Thanks for the information. Sounds like this is exactly what we do. We authenticate all our users (students/faculty/staff) via shibboleth.

We use this package https://github.com/uabookstores/laravel-shibboleth to achieve this. Steps:

  1. Have a shibboleth configuration(mapping of shibboleth entities)
  2. Install the package and migrate.
  3. Add your configuration to config/shibboleth.php file in your laravel application. (Holds info about redirect after authentication/ add fields to User model etc.)
  4. Add the routes to your web.php file.

Done. If you are facing issues in any of the above steps, let me know.

Nov
19
3 months ago
Activity icon

Replied to Shibboleth Authentication

Hey @konrms I might be too late but I use this package everyday. Could you be more specific in describing your issue. I might be able to help you.