EbrahemSamer

EbrahemSamer

Member Since 2 Years Ago

Experience Points
8,430
Total
Experience

1,570 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
64
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 2
8,430 XP
Feb
25
1 day ago
Activity icon

Replied to How To Solve -- Failed To Load Resource: Net::ERR_CONNECTION_RESET --

no other errors but sometime this errors get with it

( POST .. filename ... net::ERR_CONNECTION_RESET )

I think its the same error....

This happen on chrome yeah I did not try another browser but i read that happen with all @sinnbeck

Activity icon

Started a new Conversation How To Solve -- Failed To Load Resource: Net::ERR_CONNECTION_RESET --

I am sending ajax request and everything was working fine but suddenly this error -

( Failed to load resource: net::ERR_CONNECTION_RESET )

Start to show up at every ajax request and sometimes does not happen but usually it does .... I do not know why that happens ..

I am on real server using PHP

error_log is empty.

Feb
17
1 week ago
Activity icon

Started a new Conversation How To Send An Email Using PHP ?

I am on bluehost server and I find out that phpmailer is the best way to send an email.

What smtp to use ? the username is username of bluehost account ? the password is password of bluehost account ?

thanks

Feb
12
2 weeks ago
Activity icon

Replied to How To Search In Two Table Dynamically PHP ?

@sinnbeck Pure PHP, I want an idea..

also two tables have different fields.... and different rules for search

Activity icon

Replied to How To Search In Two Table Dynamically PHP ?

no the application will know which table to search in . @psylogic

Activity icon

Started a new Conversation How To Search In Two Table Dynamically PHP ?

I've two tables .. say users table and books table I wanna make search in both but I wanna write the code once dynamically . understand which table should look in and what fields should use to search.

Any Ideas ?

Feb
10
2 weeks ago
Activity icon

Replied to What The Best Way To Make User Able To Send Pdf Or Excel File To Whatsapp Through My PHP App ?

@fylzero yeah I know, how to send it from my server, is there an API to use

Activity icon

Started a new Conversation What The Best Way To Make User Able To Send Pdf Or Excel File To Whatsapp Through My PHP App ?

I am building an application and user can download pdf files and excel and there is a third option that he can send this file to his friend as pdf file in whats-app

what should I use to make that ?

Activity icon

Started a new Conversation Why Image Removed After Using It One Time PHP && TCPDF ?

I am using TCPDF to generate pdf files and i am using image as a background and it works fine for one time after that it removed from the server ?

my code

class MYPDF extends TCPDF {

public function Header() {

    $bMargin = $this->getBreakMargin();

    $auto_page_break = $this->AutoPageBreak;

    $this->SetAutoPageBreak(false, 0);

    $img_file = 'upload/pdf_image.jpeg';

    $this->Image($img_file, 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0);

    $this->SetAutoPageBreak($auto_page_break, $bMargin);

    $this->setPageMark();

    

}

}

Feb
08
2 weeks ago
Activity icon

Started a new Conversation What Is The Best Way Or Library To Convert Table To PDF And Download PHP ?

I am building website has many tables and i wanna include a button to each page so user can click on it and download this table in pdf , excel or send to whatsapp......

PHP

thanks

Feb
07
2 weeks ago
Activity icon

Started a new Conversation How Can I Get Device Name Or Any Unique Value In Device ?

I am making website that can only accessed in one device per account - so I wanna get some unique value for the computer or OS to depend on it.

How can i do that? ( PHP / JS )

Activity icon

Started a new Conversation How To Prevent User From Accessing His Account From Another Device ?

I am working on website and I want this user to login from one device or more if I want , How can i do this ?

I was thinking that cookies may help but he can pick another browser.....

Feb
06
2 weeks ago
Activity icon

Started a new Conversation How To Prevent Multiple Login Using The Same Account On Different Devices PHP ?

I am making website and I want the user to login on just one device....

I was thinking to add extra column in the database to set it to "active" when login and "not active" when logout and depend on it at each login process....

Is this good way to do that ... or there is a better and optimized solution ?

Activity icon

Started a new Conversation How To Arrange Mysql Query Result According To Where Conditions ?

I am running query like

$query = "SELECT * FROM students WHERE name = ahmed or age > 20";

the result will be any person has name ahmed or greater than 20 years

I want the name result get first ( all students have this name 'ahmed' ) not the age .

How can i do this ?

Activity icon

Started a new Conversation How To Update Mysql Character Sets To Support Some Arabic Chars ?

I am working on server and some arabic characters mysql does not support it or understand it , so I wanna find this file " /usr/share/percona-server/charsets/ " to update it ... How to find it .

characters :

wanna أ to be = ا

و == ؤ

and so on

Feb
02
3 weeks ago
Activity icon

Started a new Conversation How To Make Mysql Treat ا ( Alef Character In Arabic ) Like أ ( Hamza Character In Arabic ) ? )

I am searching for احمد

but name like أحمد do not get with the result because mysql understands that they're different characters

how to make them the same . any ideas ?

Activity icon

Started a new Conversation How To Replace Part Of String With * And Show The Rest ( PHP ) ?

I am searching using the name , I want the result of search to be like that

if i searched for any person start with 'ahmed' the result would be like that

ahmed ********* ahmed *** ahmed*

and so on just ahmed appears and the rest will be hidden like that how can i do that ?

Feb
01
3 weeks ago
Activity icon

Started a new Conversation How To Get Family Members Using Person's Name MYSQL ?

I've made sql statement to get brothers, uncles cousins and son of cousins if exist.

I typed this sql

$query = "SELECT secondname, thirdname, forthname, familyname, fullname, job, dob, address, internal_reference FROM public_elections WHERE";

                                    $query .= " ( secondname = '$secondname' && thirdname = '$thirdname') || ( secondname = '$thirdname' && thirdname = '$forthname' )";

                                    $query .= " || ( thirdname = '$thirdname' && familyname = '$familyname' ) || ( forthname = '$thirdname' ) ";

but still not working 100% correct and it gets persons not related.

how can i fix it.

Jan
28
4 weeks ago
Activity icon

Started a new Conversation How To Speed Up Search ( 1 Million Record ) PHP & MYSQL?

I am searching on table using query like this

select * from table_name where f_name = .... and l_name = ..... and gender = male and ... ............. etc

the result shows in 3 seconds, is there is any thing i can do to make it fast.. ( I am using PDO ).

Jan
27
4 weeks ago
Activity icon

Started a new Conversation Why PDO Insert Query Executed Two Times ?

I am inserting using this code

////////////////

$action_name = "بحث"; $action_doer_id = $_SESSION['user_id'];

$query = "INSERT INTO transactions (transaction_name, transaction_user_id, transaction_notes) VALUES ('$action_name', $action_doer_id, '$notes')";
$stmt = $pdo->query($query);
$stmt->execute();

//////////////

the result is two records added in database why ? ( note ) but there is a query before it should i call it query2 instead of query and stmt2 instead of stmt

Jan
22
1 month ago
Activity icon

Replied to How To Import Multiple CSV Files To Localhost Without Overwriting Data ?

I do not use any code, I just created an empty database on localhost and I have csv file, I wanna enter to my database on localhost and importing this csv file to fill my database with it .

it works fine but I upload another csv file , the old data removed and the new data in the new file inserted ( data overwritten ) I wanna when I upload another file, new data inserted after the old data... thanks.

@bobbybouwmann

Activity icon

Replied to How To Import Multiple CSV Files To Localhost Without Overwriting Data ?

@bobbybouwmann .. I mean importing from localhost not uploading using code

Activity icon

Started a new Conversation How To Import Multiple CSV Files To Localhost Without Overwriting Data ?

I wanna import csv file to localhost and It works correctly, when I import another one, old data gone,

I wanna continue on the old data not overwrite it.

Jan
21
1 month ago
Activity icon

Started a new Conversation How To Run Seed With 1 Million User ?

I wanna generate random users ( 1 million ) but I get this error how can i solve it ?

Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in C:\xampp\htdocs\blog\vendor\fzaninotto\faker\src\Faker\Provider\Base.php

Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in C:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php

Jan
14
1 month ago
Activity icon

Replied to How To Make CRUD Operations One Time For All Tables ?

@bugsysha Thanks , you mean I can not do that using PDO ?

Activity icon

Started a new Conversation How To Make CRUD Operations One Time For All Tables ?

I am making a gallary system using PHP OOP and I wanna make crud operation to work in all tables without issues.

I am trying that but the problem I am facing that how can get attributes for all classes dynamic and how to get the values of these attributes.

Wanna tutorial or guide to learn from it how to do that ... I am using PDO.

Jan
13
1 month ago
Activity icon

Replied to What The Best Way To Make A Bout 500 Pages Have Some Static And Other Dynamic Parts ?

I do not know exactly cause it's the first time to face something like that... Is it right to make single static page and the dynamic parts I will get it dynamically from DB depending on the URL above ? @bugsysha

Activity icon

Replied to PHP Native: Filter_input Vs Validate_Email Vs Sanitize Email..

@bugsysha Great so I am gonna use just filter_input to sanitize and validate... thanks for replying.

Activity icon

Started a new Conversation What The Best Way To Make A Bout 500 Pages Have Some Static And Other Dynamic Parts ?

There is a client wanna make 500 page in his website, what is the smart way to do that like a ( Silo structure )?

Jan
09
1 month ago
Activity icon

Started a new Conversation PHP Native: Filter_input Vs Validate_Email Vs Sanitize Email..

What is the difference between sanitizing email and validating email ?

Which one should I use in login or registration form using php native?

Is filter_input function enough to use while getting variables from post request to validate it right?

Thanks.

Dec
13
2 months ago
Activity icon

Replied to How To Send Ajax Request On Data That Added By Another Ajax Request ?

@himanshurajvanshi I am already add a new div that has all category data that added using ajax within the delete and edit buttons and this delete button does not work with ajax.

Dec
12
2 months ago
Activity icon

Started a new Conversation How To Send Ajax Request On Data That Added By Another Ajax Request ?

In my laravel application I can add and delete categories using ajax and it works fine But when I add a new category and try to delete it without refreshing, It's deleted in the default way and page refreshed.

why ajax did not work on the delete button that added from the controller.

Dec
10
2 months ago
Activity icon

Started a new Conversation How To Use Function On The Value Of Laravelcollective Textarea ?

I want to use stripe_tags() on the value of the textarea in editing but I can not access this value...

Code:

{!! Form::model($post, ['method'=>'PATCH','action'=>['Admin\[email protected]', $post->id], 'files'=>true]) !!}

        <div class="form-group">
            {!! Form::label('title', 'Title') !!}
            {!! Form::text('title', null, ['class'=>'form-control']) !!}
        </div>
        <div class="form-group">
            {!! Form::label('content', 'Content') !!}
            {!! Form::textarea('content',null, ['class'=>'form-control', 'id' => 'postcontent']) !!}
        </div>
        <div class="form-group">
            {!! Form::label('category_id', 'Category') !!}
            {!! Form::select('category_id',$categories,null, ['class'=>'form-control']) !!}
        </div>
        <div class="form-group">
            {!! Form::label('photo_id', 'Post Thumbnail') !!}
            {!! Form::file('photo_id', ['class'=>'form-control']) !!}   
        </div>
        <div class="form-group">
            {!! Form::submit('Update Post',['class'=>'btn btn-info']) !!}
        </div>

    {!! Form::close() !!}
Dec
06
2 months ago
Activity icon

Started a new Conversation How To Install Laravel Homestead ?

While installing homestead I'm getting this error

failed to locate the powershell executable on the available path . please be sure that powershell is installed and available on the local path

should setup powershell again and how to add it in the path variable.

Nov
30
2 months ago
Activity icon

Started a new Conversation Why I Get Two Warning While Installing Npm On Laravel Project ?

I got two warning when installing npm... is that okay ?

NPM WARN optional skipping optional dependency: fsevent..... NPM WARN notsup skipping optional dependency: unsupported platform for fsevent.....

How can I set it up correctly?

Nov
27
2 months ago
Activity icon

Started a new Conversation How Important Is TDD, Is It Essential In Big Projects ?

I've learnt laravel and have built some projects and I wanted to start with ( Build Forum Using TDD ) Course here in laracasts, But I do not know anything about TDD so Is it something I have to learn first or I can learn while studying the course.

If I have to learn it, any source or course ?

Nov
19
3 months ago
Activity icon

Started a new Conversation What Is The Best Way To Follow In Order To Build An Ecommerce App ?

I want to build an eCommerce application to learn online payment and stuff like that.

I've already build some laravel application and want to learn about eCommerce what resources or docs or thing I can follow to make that happen.

I found some udemy courses but have bad rating. any advice.

Nov
17
3 months ago
Activity icon

Started a new Conversation Is Login And Register Using Socialite Package Required Real Domain ?

Simple question :

I wanted to know if facebook and github can let me using socialite package for login and register using localhost not real domain. is it available or not ?

Nov
16
3 months ago
Activity icon

Replied to How To Make Laravel Differ Between Routes With Parameters And Regular Routes ?

@sinnbeck yeah I did that but I wanted to know if there is another solution

Activity icon

Started a new Conversation How To Make Laravel Differ Between Routes With Parameters And Regular Routes ?

I've this route.

Route::patch('/company/{id}', '[email protected]')->middleware(['auth','onlycompany']);

and this one.

Route::patch('/company/profile', '[email protected]');

problem is the first one is executed whenever I call company/profile

how to make it understand which is parameters and which is regular string.

thanks

Activity icon

Started a new Conversation How To Control In Redirect Function Depends On The Clicked Button?

I can delete users from two pages dashboard page and users page.

when I delete user from users page the page returns back to users page and the same thing happen whien i delete it from dashboard.

What I want is when i delete user from dashboard the page returns to dashboard not users.

// delete user function

public function destroy(User $user)
{
    if($user->emp_type == "employee") {
        $user->userprofile->delete();
    }else {
        $user->companyprofile->delete();
    }
    $user->delete();
    return redirect()->route('users.index')->withStatus(__('User successfully deleted.'));
}
Nov
14
3 months ago
Activity icon

Started a new Conversation How To Prevent Button Name And Value From Showing Up In The Url?

I wanna make search in my blog and I've already made a from and it has get method to show in the url but the search button appears in the url as a parameter like (?q=hello&search_btn = search).

Question is : is that okay to let it or should I hidden it and how to do that?

and is there is a better way to search in laravel except ( algolia ) because it simple search.?

the form

                <input type="text" name="q" class="searchText" placeholder="what do you want to read..." required>

              </div>
                <input type="submit" name="searchbtn" class="main-button" value="Search Now">
             </form>
Nov
12
3 months ago
Activity icon

Started a new Conversation Why Ajax Calls Do Not Execute On Appended Html?

I've comments system, I want user to add comments and delete its own without refreshing the page and it works fine but when user add comment using ajax and delete the same added comment it deleted but after page refreshed.

javascript

$(".deletecomment").on("submit", function(e) { e.preventDefault();

    let slug = $(".deletecomment input[name='slug']").val();
    let data = $(this).serialize();
    $.ajax({
        url: '/blog/post/'+slug,
        method: "Delete",
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        },
        data: data,
        dataType: 'json',
        success: function(data) {
            $(".comment"+data.success).remove();
        },

    });
});

HTML

@csrf @method('DELETE')
                                    <a data-target="#updatecomment" data-toggle="modal" href="" class="btn btn-secondary btn-sm">Edit</a>
                                    @if($comment->comment_type == 'comment')
                                    <a href="" class="btn btn-info btn-sm">Reply</a>
                                    @endif

                                    <input type="hidden" name="comment_id" value="{{ $comment->id }}">
                                    <input type="hidden" name="slug" value="{{ $comment->post->slug }}">
                                    <input onclick="return confirm('Are you sure?');" type="submit" value="Delete" class="btn btn-danger btn-sm" />
                                </form>
Activity icon

Replied to Why Ajax Calls One Time?

I have that id but the form does not show in the laracasts editor i do not know why any way i will use class instead thanks.

Activity icon

Started a new Conversation Why Ajax Calls One Time?

I've comments in blog and every comment has delete button to delete the comment,

I wanna delete it using ajax without refreshing the page.

so I've made ajax call when the form submitted and it works but for one comment and the another comment the page is refreshed.

// the ajax call

$("#deletecomment").on("submit", function(e) {
    e.preventDefault();
    
    let slug = $("#deletecomment input[name='slug']").val();
    let data = $(this).serialize();
    $.ajax({
        url: '/blog/post/'+slug,
        method: "Delete",
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        },
        data: data,
        dataType: 'json',
        success: function(data) {
            $("#comment"+data.success).remove();
        },
    });
});

HTML

@csrf @method('DELETE')
                                    <a data-target="#updatecomment" data-toggle="modal" href="" class="btn btn-secondary btn-sm">Edit</a>
                                    @if($comment->comment_type == 'comment')
                                    <a href="" class="btn btn-info btn-sm">Reply</a>
                                    @endif

                                    <input type="hidden" name="comment_id" value="{{ $comment->id }}">
                                    <input type="hidden" name="slug" value="{{ $comment->post->slug }}">
                                    <input onclick="return confirm('Are you sure?');" type="submit" value="Delete" class="btn btn-danger btn-sm" />
                                </form>

// delete function

public function destroyComment(Request $request) {

    $comment = Comment::findOrFail($request->comment_id);
    if($comment) {
        $comment->delete();
        $success = $comment->id;
    }
    return response()->json(['success' => $success], 200);
}
Activity icon

Replied to How To Unistall Package Which I've Already Installed ?

I was joking man, but do not bother yourself anyway.