afrasiyabhaider

afrasiyabhaider

Web Developer at Self Employed

Member Since 10 Months Ago

Gujrat

Experience Points
3,550
Total
Experience

1,450 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
17
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.

Level 1
3,550 XP
Jan
19
1 week ago
Activity icon

Started a new Conversation E-bidding Website

I want to develop a multi-vendor e-bidding website (like ebay) with laravel. Please suggest me if there is any available script or anything that would help me

Jan
14
1 week ago
Activity icon

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

I want to show the name of role which have identical set of permissions Role is in Roles table Checking Permissions from Role_has_Permissions table so this worked in my case

Activity icon

Awarded Best Reply on How To Check Same Set Of Permissions Assigned To Another Role?

Found Solution @prasadchinwal5 thank you for helping

 $roles = Role::get();
        $permissions = $request->input('permissions');
        $notSame = false;
        $sameRole = null;
        for ($i = 0; $i < count($roles); $i++) {
            $role_permissions[$i] = $roles[$i]->getAllPermissions()
                ->pluck('id')->toArray();
            for ($j = 0; $j < count($role_permissions[$i]); $j++) {
                if ($role_permissions[$i] == $permissions) {
                    $notSame = true;
                    $sameRole = $roles[$i];
                    break;
                }
            }
        }
        /**
         * Below condition will check if same set of permissions is
         * not assigned to any other role then It will be processed
         * further otherwise user have to choose different set of
         * permission
         *
         */
        if ($notSame && ($sameRole != null)) {
            alert()->warning('Role Already Exists', 'A role named as "' . $sameRole->name . '" with same permissions 
             already exists try with another permissions set');
         return redirect()->back();

        } else {

    - Write here your code to store into DB
    }

Activity icon

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

Found Solution @prasadchinwal5 thank you for helping

 $roles = Role::get();
        $permissions = $request->input('permissions');
        $notSame = false;
        $sameRole = null;
        for ($i = 0; $i < count($roles); $i++) {
            $role_permissions[$i] = $roles[$i]->getAllPermissions()
                ->pluck('id')->toArray();
            for ($j = 0; $j < count($role_permissions[$i]); $j++) {
                if ($role_permissions[$i] == $permissions) {
                    $notSame = true;
                    $sameRole = $roles[$i];
                    break;
                }
            }
        }
        /**
         * Below condition will check if same set of permissions is
         * not assigned to any other role then It will be processed
         * further otherwise user have to choose different set of
         * permission
         *
         */
        if ($notSame && ($sameRole != null)) {
            alert()->warning('Role Already Exists', 'A role named as "' . $sameRole->name . '" with same permissions 
             already exists try with another permissions set');
         return redirect()->back();

        } else {

    - Write here your code to store into DB
    }

Activity icon

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

@prasadchinwal5 It will check only one permission because of using diff() but I want to check array of newly assigned permissions with another array of permissions which already exists.......

Jan
13
2 weeks ago
Activity icon

Started a new Conversation How To Check Same Set Of Permissions Assigned To Another Role?

I am using spatie permission package and I want to make sure that two roles with different names must not have same permissions while creating a role e.g

Role A
 - Pemission 1
 - Permission 2
 - Permission 3

Role B
 - Pemission 1
 - Permission 2
 - Permission 3

If this happens system should not create 2nd role "Role B"

Can anyone please guide me?

Activity icon

Awarded Best Reply on Images Not Displaying In Views

I've found solution

I putt following code into my public/.htaccess and now its running at rocket speed :D

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
Activity icon

Replied to Images Not Displaying In Views

I've found solution

I putt following code into my public/.htaccess and now its running at rocket speed :D

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
Activity icon

Replied to Images Not Displaying In Views

When i put image in public folder it works fine but when i try to access public/storage it doesn't work at all

Activity icon

Replied to Images Not Displaying In Views

This is on localhost and When i write {{asset('storage/'.$value->image)}} i get the exact path @fylzero @bugsysha

http://github.camppus.edu:8080/storage/uploads/images/staff/6zuYSn7wKiYWXDBp3zsLimWnQbNrAv0794asKwYY.jpeg

@jlrdw It was working fine 3 days ago with the same code but suddenly this thing happen

Please tell me a solution for this error/mistake

Jan
12
2 weeks ago
Activity icon

Started a new Conversation Images Not Displaying In Views

I've linked my storage folder into public by running php artisan storage:link when i access those images it displays accurate url with accurate name but when I gives image path into src tag it doesn't display image and when i paste image url with base_url then it displays a page of forbidden please help me tp solve this issue. i am using below code to display image

{{asset('storage/'.$value->image)}}
Jan
09
2 weeks ago
Activity icon

Replied to Laravel 5.3 Blank White Screen No Errors

run command

php  artisan key:generate

problem solved in my case

Jan
08
2 weeks ago
Activity icon

Replied to Dynamic Time With Carbon

date_default_timezone_set("timezone"); Write this line in boot() which is located inside app\Http\Providers\AppServiceProvider class and change timezone according to yours

Dec
07
1 month ago
Activity icon

Replied to How To Load Jfif Pictures

Just like a Normal Image File....

Activity icon

Replied to Blade, Partials, Javascript, Structure!

Why do you want to @include file...? You can simply write the code and append it after the row

Nov
28
1 month ago
Activity icon

Replied to Login Route Redirect Page Not Found Why?

Can you please share your route?

Nov
19
2 months ago
Activity icon

Replied to How To Update Or Create - HasMany/BelongsTo (One To Many) Relation

@mabdullahsari @snapey Here is my code..

for ($i = 0; $i < count($degree_name); $i++) {
            $user->teacher()->first()->teacher_qualification()->whereTeachersId($user->teacher()->first()->id)- 
            >updateOrCreate([
                'degree_name' => $degree_name[$i],
                'teachers_id' => $user->teacher()->first()->id,
                'board_university' => $board_university[$i],
                'degree_roll' => $degree_roll[$i],
                'passing_year' => (int) $passing_year[$i],
                'obtained_marks' => $obtained_marks[$i],
                'total_marks' => $total_marks[$i]
            ]);
        }

A teacher have multiple previous qualifications it is one to many relationship. User can

  • add teacher's one more previous qualifications
  • only update already saved record
  • delete one record while updating

So please suggest me what should i use in this case?

Nov
17
2 months ago
Activity icon

Replied to Issue In HasMany() Relationship

I've used softDeletes so it will make issue for me when I delete like this. I have to do forceDelete() which I don't to use. Is there any other option?

Nov
16
2 months ago
Activity icon

Replied to SoftDelete Issues

Try

$site = Site::withTrashed()->all();

Nov
14
2 months ago
Activity icon

Started a new Conversation Issue In HasMany() Relationship

Can anyone please tell me how to updateOrCreate() on an array in hasMany() relationship?

Nov
13
2 months ago
Activity icon

Started a new Conversation How To Build Schema For Student, Course And Class Relation?

I want to allocate courses to

  • students
  • class
  • course
I basically want to make the relation of

    - courses with class
    - class with students

so students should have all courses which are taught in the chosen class but some of the students might not be allowed to study a few courses allocated to the class

please guide me on how to create the schema for this situation?

Activity icon

Awarded Best Reply on One Model Having 'hasMany' Relation With Multiple Model

@ there is a code for storing student but it is still not working

$student->save();
Nov
02
2 months ago
Activity icon

Replied to How To Get Files InLaravel Controller As Normal File Element By Using FilePond.js?

@sinnbeck Thank you I want to convert this file into PDF and then store it. Can you suggest me something for that?

Activity icon

Replied to How To Get Files InLaravel Controller As Normal File Element By Using FilePond.js?

@mstrauss @sinnbeck I am implementing filepond.js and $request->input('file');response is as follows

{"id":"q8vlfi9eg","name":"P068.doc","type":"application/msword","size":41984,"metadata":{},"data":"0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABA...}
Nov
01
2 months ago
Activity icon

Started a new Conversation How To Get Files InLaravel Controller As Normal File Element By Using FilePond.js?

I want to send file to Laravel Controller along with other form fields data, but I am using FilePond.js [https://pqina.nl/filepond/] which sends file as an Async request.

I used FilePondPluginFileEncode plugin and I got file's data as Json object, But I am unable to store data because I didn't find any temp/location of the file.

Here is the Code I've tried

 $file = $request->input('file');
 $name = json_decode($file[0])->name;
 $data = substr($file[0], strpos($file[0], ',') + 1);
 $data = base64_decode($data);
 $storage = Storage::disk('local')->put($name, $data);
  • It stores empty files (with correct name and format)

  • I want to get file with in Laravel's Controller so I can send them to Google Drive

Oct
24
3 months ago
Activity icon

Started a new Conversation How To Remove Data But Not Permanently From Table?

Please guide me on how to remove data but ---not--- delete permanently from table??

Oct
20
3 months ago
Activity icon

Started a new Conversation Driver [google_drive] Is Not Supported.

I am using a package nao-pon/flysystem-google-drive:~1.1 for google drive api implementation and getting error which is mentioned above. I've also updated my config\filesystem.php file but error is still there.

Please tell me how to resolve this error

Oct
18
3 months ago
Activity icon

Replied to Best Resource To Implement Google Drive API ??

I've read the Documentation but I want tO know how tO implement it in Laravel. In a professional way.. Like there is a Login With google using Socialite so is there any other way.. any other package or anything???

Activity icon

Started a new Conversation Best Resource To Implement Google Drive API ??

I want to get and send data into google drive from my laravel application. Anyone can tell me that how to implement Google Drive Api in Laravel 6?

Oct
14
3 months ago
Activity icon

Started a new Conversation Default Authentication In Google API

I am building an application in which I will display lectures to students. Those Lectures should be on my Google Drive. So how can I prevent google OAuth screen to get Login Authentication of user. I dont want my user to be redirected to google consent screen.

Is there any solution?

Oct
04
3 months ago
Activity icon

Started a new Conversation How To Implement API Of Google Classroom??

I want to implement Google classroom's api can anyone please guide me with the process? I've read the documentation but I didn't understand how to do it in Laravel. can you guys please help me! Here is the link

https://developers.google.com/classroom/quickstart/php

Sep
04
4 months ago
Activity icon

Replied to One Model Having 'hasMany' Relation With Multiple Model

@ there is a code for storing student but it is still not working

$student->save();
Activity icon

Started a new Conversation One Model Having 'hasMany' Relation With Multiple Model

I have a student model in which I've created these two relations

- Student Model

    public function previous_academic_record()
    {
        return $this->hasMany(previous_academic_record::class);
    }
    public function student_guardians()
    {
        return $this->hasMany(student_guardians::class);
    }

I have two more models named as

  • previous_academic_record
  • student_guardians

which belongsTo students

- In the student guardian model

public function students()
    {
        return $this->belongsTo(students::class);
    }

- in the previous academic record model 

public function students()
    {
        return $this->belongsTo(students::class);
    }

now please tell me how to save records

when I write below code it does not save student_id (does not create a reference to student)

 $student = new stduents();

$student->previous_academic_record()->create([]);

and 

$student->studnet_guardians()->create([]);

Please tell me how to figure this out

Aug
30
4 months ago
Activity icon

Replied to How To Build Schema/model Of Tables For Student/Course Allocation

@malico thank you for your replay but I want to assign course to semester and then allocate semester to the student so a student can have all courses taught in selected semester.

Can you help me in understanding this scenario!

Activity icon

Started a new Conversation How To Build Schema/model Of Tables For Student/Course Allocation

I want to allocate courses to

  • students
  • semesters
I basically want to make the relation of

    - courses with semester
    - allocate semester to students

so students should have all courses which are taught in the chosen semester

please guide me on this

Aug
25
5 months ago
Activity icon

Replied to Need To Sort Prodcut By Price ASC And DESC

@r0.it

use following code inside controller -> products funtion

Product::orderBy('price','desc')->get();

problem solved

Activity icon

Started a new Conversation How To Update Or Create - HasMany/BelongsTo (One To Many) Relation

Please guide me on how to (update or create) student's previous academic record. I want to allow admin to add new academic record while updating the existing one as well that why I want to know about (createOrUpdate).

students Model

public function previous_academic_record()
    {
        return $this->hasMany(previous_academic_record::class);
    }


previous_academic_record Model

public function students()
    {
        return $this->belongsTo(students::class);
    }
Aug
22
5 months ago
Activity icon

Replied to Need Your Suggestion!

I am not familiar with anyone of these technologies I want to learn it and implement it

Activity icon

Replied to Need Your Suggestion!

I want to learn something new thats why I am asking from you guys as you have much experience and familiar with this kind of job

Cam you please guide me how to use Angular7 with Laravel 5.8?

Activity icon

Started a new Conversation Need Your Suggestion!

I am developing an application in Laravel, so I need a suggestion form you guys, what should I use for frontend Vue.Js or Angular7 in my project?

and please guide me about the Pros and Cons.

Aug
21
5 months ago
Activity icon

Replied to Laravel 5.8 With Angular7

Thank You @

Activity icon

Replied to Laravel 5.8 With Angular7

@ But I have an ongoing project in which 50% of work is already done and now PM told us to do the rest of the work with Angular7

Activity icon

Replied to Laravel 5.8 With Angular7

@alkut Thank you but I've already searched for this tutorial. JWT which is used in this tutorial is now replaced by the community member Open this link and read the announcement on top of the page

https://laravel-angular.io/docs/1/angular-install/

Could you please suggest me another tutorial in which Laravel and Angular are managed in Single Project and not deal as 2 different projects?

Activity icon

Started a new Conversation Laravel 5.8 With Angular7

Can anyone please suggest me some tutorial for learning laravel 5.8 with angular 7. I've searched on google but I didn't find anything interesting Could you guys please help me out?

Aug
19
5 months ago
Activity icon

Replied to How Should I Don't Show Login Form Of Teacher If Already Logged In As Student?

I write these lines into all of my login controllers (student, teacher, staff)

    $this->middleware('guest:staff')->except('logout');
    $this->middleware('guest:student')->except('logout');
    $this->middleware('guest:teacher')->except('logout');
Activity icon

Started a new Conversation How Should I Don't Show Login Form Of Teacher If Already Logged In As Student?

I am using the multi-auth system and I am facing the problem. If I logged in as a student and I type route of teacher login form my application takes me there. Please tell me

How should I don't Show login form of the teacher if already logged in as a student