BishoyWagih

BishoyWagih

Member Since 2 Years Ago

Alexandria

Senior solution developer at Link Development

Experience Points 48,310
Experience Level 10

1,690 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 254
Lessons
Completed
Best Reply Awards 36
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.

13 Jun
2 months ago

BishoyWagih left a reply on Values With 00 As Decimals Not Showing After Querying From Database

try to create get attribute for the decimals in case they don't have number after the point.

BishoyWagih left a reply on Too Few Arguments To Function App\Http\Controllers\ShowrecordController::index(), 0 Passed And Exactly 1 Expected

1 - try to dump inside the index function to make sure the route is correct. 2 - make sure the view is found and the path is set correctly 3 -

   public function index($id)
   {
  dd($id);
   $data = File::findOrFail($id);

$pdfdata = \DB::table('importpdfs')->get();

return view('showrecord', compact('data', 'importpdfs'));
}

importpdfs variable passed to the view must be $pdfdata

BishoyWagih left a reply on Too Few Arguments To Function App\Http\Controllers\ShowrecordController::index(), 0 Passed And Exactly 1 Expected

because you have one argument passed to index function $id and you didn't pass it in route get request,

you have to change the resource route to

  Route::get('showrecord/{id}','[email protected]');
07 May
3 months ago

BishoyWagih left a reply on How To Show Message (MOTD) On All Pages?

check is session has flash message in header page, then print the message from the session.

BishoyWagih left a reply on Curl Error

actually it's simple laravel login, no using for Curl requests,

laravel passport is installed is it related to anything?

BishoyWagih started a new conversation Curl Error

my application was works fine but i got this error after login

cURL error 77: (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

scrren shot for the error

https://imgur.com/oy14Kyg

31 Mar
4 months ago

BishoyWagih started a new conversation Laravel Scout Multiple Tables

I have 4 DB tables, Posts, Comments, Replies and Users and i’d like the user when he searches to obtain results from all those tables. I know i might build different templates for each model, but i’d like the results in the same container. Is it possible?

16 Mar
5 months ago

BishoyWagih started a new conversation Laravel Error Logging

why any error in for substitution not showing in laravel.log file.

although the APP_ENV is local and APP_DEBUG is true

BishoyWagih left a reply on Grabbing Parameter From URL

did you try $request['#access_token'];

but better you can pass the access_token as query string just like

https://mysite.com?access_token=647384ur848383

then you can use $request['access_token'];

BishoyWagih left a reply on PHP Sendmail Function How To Use In Laravel

check the official documentation.

https://laravel.com/docs/5.8/mail

but simply you can send mail with this way

\Mail::to("[email protected]")->send();

BishoyWagih left a reply on Validator

please be more clarify.

BishoyWagih left a reply on Update Ids On Ajax Update

create another column in your database table let say it's name will be "lessons_order",

when you select lessons from the controller make them ordered by lessons_order.

in every lesson movement you have to update the lessons order in the database.

you can use Jquery Sortable to handle lessons order

https://jqueryui.com/sortable/

14 Mar
5 months ago

BishoyWagih left a reply on Intervention - Image Too Big

i have the same issue although php.ini file max-file-size is 200M, any Updates.

01 Mar
5 months ago

BishoyWagih left a reply on Conditional Validation Rule With Custom Message?

what do you mean with validation? i think you want to return back if the $task->Status is not completed?

BishoyWagih started a new conversation Caching Views?

what is the best way to cache my blade views and rebuild cache if any update happened ?

27 Nov
8 months ago

BishoyWagih started a new conversation Hackathon

any app ideas for hackathon? or any help...

BishoyWagih left a reply on Weird: Undefined Variable Error

your code seems good except this line..

 $custom_menu_items = Custom_menu_items::where('userid', '=', Auth::user()->id)->latest();

latest() is a method for ordering the query not fetching the data,

so you have to get them or to paginate

 $custom_menu_items = Custom_menu_items::where('userid', '=', Auth::user()->id)->latest()->get();
17 Nov
9 months ago

BishoyWagih left a reply on Database Structure Help

@AHMEDDABAK - what about a query with 2 attributes to get an item, for example, I need to get an item with color=red & size=300

the problem appears for me that if I make a query with "AND" it will return no result.

if I make a query with "OR" will be totally wrong

My expected result should be a record from the products table which is "tomato juice"

BishoyWagih started a new conversation Database Structure Help

Help me to think of this: I have a lot of items on my menu

Ex:

Orange juice: Color: orange , Size: 200ml:500ml

Tomato juice: Color: red , Size: 200ml:400ml

Pizza: Length: 20cm , Weight: 200gm:400gm

I need API to get the item exist or not on the menu

Example: /is-exist?type=pizza&weight=250&length=20 Return true

/is-exist?type=pizza&weight=250&length=25 Return false

I need an appropriate database structure for that and query that will return row(exist) or empty(not exist) from database

Note: properties of each product could be range or single value each product have its own properties and each property could be on multiple menu items

16 Nov
9 months ago

BishoyWagih started a new conversation Select From Array Field In Database

I have a database table with three fields

id (integer) say value=> 1

color (string) say value => 'red'

length (array) [1 , 8]

how can I select where color = 'red' and the given length in length between 1 and 8?

ps iam using laravel eloquent...

24 Sep
10 months ago

BishoyWagih left a reply on Get To Know If The Database Table Row Has Any Changes After Update..

actually i don't want to use it, i need a manual solution or any ideas..

BishoyWagih started a new conversation Get To Know If The Database Table Row Has Any Changes After Update..

I'm developing an application with Laravel, and i'm creating a user Log,

so when the user update any model i need to record this action if only any changes in

database table has occurred.

18 Sep
11 months ago

BishoyWagih left a reply on SQLSTATE[23000]: Integrity Constraint Violation: Foreign Key

insted of

 $table->foreign('other_id')->references('other_id')->on('others');

use

 $table->foreign('other_id')->references('id')->on('others');

reference key relate to the primary key on related table..

BishoyWagih left a reply on Customer Database Schema

your database looks good,

but please note, Laravel's naming convention for pivot tables (CustomerAddresses) is

singularized table names, in alphabetical order separated by an underscore.

so you can rename the pivot table (CustomerAddresses) to be (address_customer)

its the best practice.

also you can set a composite primary key for (CustomerAddresses) table

['customer_id' , 'address_id'], to prevent multiple insertion for the same customer with

the same address instead of using (id) as primary key.

17 Sep
11 months ago

BishoyWagih left a reply on How To Redirect To Admin Login Page On Logout

if you setting a name for login route, so you can redirect to admin login by route name, like this..

return redirect()->route('admin.login');

here i assume your admin route login name is admin.login

07 Sep
11 months ago

BishoyWagih left a reply on Validation And Form Requests

i think you don't need to show the warning box from controller or event from request class,

instead in main view file you can check if the session has errors, then show the warning box..

11 Jul
1 year ago

BishoyWagih left a reply on Comment And Reply

it's a complete course for threads and replays and marking favorite replies,

also there are a lot of things to learn.

https://laracasts.com/series/lets-build-a-forum-with-laravel

09 Jul
1 year ago

BishoyWagih left a reply on Dynamic Drop Down

it will be generated automatically equivalent to name, so it will be company_id in your case..

BishoyWagih left a reply on Dynamic Drop Down

1 - create js file in public directory / js directory

2 - let say file name is companies.js

3 - include it in blade template

@extends('layouts.app', ['title'=>' Customers '])

@section('content')



@endsection
@section('script')

    <script src="{{ asset('js/companies.js') }}"></script>

@endsection

BishoyWagih left a reply on How To Use App.js/blade And Vue Data In Blade

you are welcome, mark this thread as close, if you find your answer..

BishoyWagih left a reply on Dynamic Drop Down

in the view, you create a seperate js file and include it in your blade temaplte

BishoyWagih left a reply on How To Use App.js/blade And Vue Data In Blade

create another vueJs component for this table, and when you click on edit button fire

an event with this id, and listen to it in <el-popover> component and do your actions..

check the documentation of how to fire event..

https://vuejs.org/v2/guide/components-custom-events.html

BishoyWagih left a reply on Dynamic Drop Down

you have to do this with ajax, so when a user select the company, it loads related

contacts to the contacts drop down..

  $(document).ready(function(){
$('#companyDropDown').change(function(){
 let companyDropDown = $(this).val();
 let lang    = $('#lang').val();
 axios.get('/getcontacts/' + company_id )
  .then(function (response) {
       $('#contactDropDown').empty();
      $('#contactDropDown').append('<option value=0> select company </option>');
      $.each(response.data , function(key , value){
          $('#contactDropDown').append('<option value='+value.id+'> '+value.name+' 
      </option>');
      });
    
    })
    .catch(function (error) {
    console.log(error);
   });
});

 });

where

companyDropDown is the id of the companies drop down

ContactDropDown is the id of the contacts drop down

BishoyWagih left a reply on How To Use App.js/blade And Vue Data In Blade

vueJs is not working in that way, you have to pass all variable you want to use to your

component, then make your updates.

BishoyWagih left a reply on How To Use App.js/blade And Vue Data In Blade

actually i can't understand you well, what do you mean with But I cant even save any

values of this.visible2, because it's blade.php format not .vue or .js

do you need to access variables from blade template which aren't in the vue component?

BishoyWagih left a reply on How To Use App.js/blade And Vue Data In Blade

1 - first make sure you run npm run dev to compile assets and make the vue component available

2 - to send data through component from blade template you can make more than one prop

<vue-component my-param="{{$laravelData}}" second-param="{{$laravelData2}}">         
     </vue-component>

please note with that way you are sending such string and variables not parsing, to

parse variable you have to bind props with :

<vue-component :my-param="{{$laravelData}}" :second-param=" {{$laravelData2}}">      
     </vue-component>

if you need to pass an array through vue component you can pass it as string and in vue

js file you can jsonParse it

BishoyWagih left a reply on Custom Messages Are Not Appearing

i think custom message must be related to attribute and the condition.. here the example from the documentation

public function messages()
   {
    return [
       'title.required' => 'A title is required',
       'body.required'  => 'A message is required',
   ];
 }

https://laravel.com/docs/5.6/validation#customizing-the-error-messages

BishoyWagih left a reply on Npm Run Dev Error

i see you have an error in your installation for missing package.

try

npm owner ls pngquant-bin
08 Jul
1 year ago

BishoyWagih left a reply on How To Return Generated Password After Create New User.

you may need to send the password before it's being hashed..

try

protected function createUser(array $data)
  {
    $password = str_random(10);
    $user =  User::create([
        'name' => $data['name'],
        'email' => $data['email'],
        'password' => bcrypt($password);
    ]);

return [
    'password'  => $password,
    'user'            => $user,
];

}

BishoyWagih left a reply on How To Use Two Fields For One Custom Validation Rule?

check this..

  $validator = Validator::make($data, [
    'start_date'    => 'required|date',
    'end_date'      => 'required|date|after_or_equal:start_date',
 ]);

https://stackoverflow.com/questions/41342818/laravel-5-3-date-validator-equal-to-or-after-start-date

BishoyWagih left a reply on Controller Not Found

share come code..

BishoyWagih left a reply on Creating Table Attributes With Specific Length In Model

try

$table->string('title', 10);
07 Jul
1 year ago

BishoyWagih left a reply on How To Set Different Language For A Defined Variable?

are you using localization, or just you need to translate some messages. ?

BishoyWagih left a reply on Undefined Controller

Show some code

BishoyWagih left a reply on How To Update Vue Instance

why you need to update the array from the blade template, you just update the

array in the vue component, then update the blade template..

BishoyWagih left a reply on Question About Slugs In The Show Method

i see you are sending two parameters in your route, while the show method

accepts only one argument..

you have to assign the second argument to the show method.

public function show($postSlug , $productSlug)
   {
    $product = Product::where('slug', $productSlug)->first();
    return view('products.products', compact('product'));
  }