ahmeddabak

ahmeddabak

Software developer at LASE PeCo

Member Since 4 Years Ago

Wesel

Experience Points
202,730
Total
Experience

2,270 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
1370
Lessons
Completed
Best Reply Awards
104
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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 41
202,730 XP
Oct
10
2 weeks ago
Activity icon

Awarded Best Reply on Laravel Validation Problem

  $request = [
            ['age' => 25,],
            ['age' => 15, 'father' => "John Doe"],
            ['age' => 40,],
        ];

        for ($i = 0; $i < count($request); $i++) {
            $validator->sometimes("items.{$i}.father", 'required|min:5', function($data) {
                //logic here for $request[$i]['age']
            });
        }
Jul
05
3 months ago
Activity icon

Awarded Best Reply on How To Make Responsive

You are using the class pull-right on the anchor tag which cases the tag to float, try using

 <li class="ui-state-default my-2 ui-sortable-handle d-flex" data-id="{{ $detail['product_id'] }}" data-name="{{ $detail['product_name'] }}"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>{{ $detail['product_name'] }}   
            <a href="#" class="ml-auto remove_data">remove</a>
        </li>
Jul
01
3 months ago
Activity icon

Awarded Best Reply on HasOne Relationship Between Two Tables From Different Databases

I think it is possible.

  • create a new connection in config/database.php for the second database.
  • in the model override the default database connection by setting the connection property protected $connection = 'second_database_connection';
  • work with the relations like you would normally do
Jun
25
4 months ago
Activity icon

Awarded Best Reply on Resolving Class From Container Is Null In Queued Job

Such problems happens when the job is serialized and then deserialized before execution. If you are resolving the instance in the constructor, Try resolving the instance in the handle method instead.

Activity icon

Replied to Where Are You All From?

Any Syrians here?

Jun
24
4 months ago
Activity icon

Replied to Two Api Request

Since both apis works correctly when you call them separately, and you do not get an error but the browser keep spinning .

Try setting a timeout on the http client you are using in the Api class prevent the call from taking too long. but this won't solve your problem, maybe the api you are trying to call has a rate limit and only allows one call per minute or maybe the called data is too big that it takes a long time to download, try contacting their support.

Activity icon

Awarded Best Reply on Compile Css And Js

Yes, for each css or js file you are making a new request to the server, the server has to find the file and send a response. it is better if you bundle your assets in one file.

Activity icon

Replied to Two Api Request

What get returned when you call both, do you get null or an error

Activity icon

Replied to Dompdf Id Givving ???

Read the docs of the package, i gave you the link

Activity icon

Replied to How To Make Responsive

You are using the class pull-right on the anchor tag which cases the tag to float, try using

 <li class="ui-state-default my-2 ui-sortable-handle d-flex" data-id="{{ $detail['product_id'] }}" data-name="{{ $detail['product_name'] }}"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>{{ $detail['product_name'] }}   
            <a href="#" class="ml-auto remove_data">remove</a>
        </li>
Activity icon

Replied to Two Api Request

Please share the logic for Countries::getApiCountries()

Activity icon

Replied to Download Options

You should wait and try again later, the limit is there so that users does not take all bandwidth downloading videos.

Activity icon

Replied to Dompdf Id Givving ???

Like i told you yesterday install this package khaledsabbah / laravel-dompdf instead of barryvdh/laravel-dompdf.

this library has support for right to left arabic letters which are used in Farsi and it exports all pdfs in utf-8 unicode

Activity icon

Replied to Compile Css And Js

Normally you do not need to extract jquery, there are some cases where this necessary like when you need to load a library after jquery but before some code in app.js is executed. but you can always import that library in app.js to resolve the problem.

to import it in the view use <script src="{{ asset('js/app.js') }}"></script> and <link rel="stylesheet" href="{{ asset('css/app.css') }}">

Activity icon

Replied to Compile Css And Js

Yes, for each css or js file you are making a new request to the server, the server has to find the file and send a response. it is better if you bundle your assets in one file.

Activity icon

Replied to Resolving Class From Container Is Null In Queued Job

Such problems happens when the job is serialized and then deserialized before execution. If you are resolving the instance in the constructor, Try resolving the instance in the handle method instead.

Activity icon

Replied to Dompdf Id Givving ???

Please explain better what you want to do, which errors you are facing. the title has no meaning, and i do not see where is the problem in the image

Activity icon

Replied to HasOne Relationship Between Two Tables From Different Databases

I think it is possible.

  • create a new connection in config/database.php for the second database.
  • in the model override the default database connection by setting the connection property protected $connection = 'second_database_connection';
  • work with the relations like you would normally do
Activity icon

Replied to How To Make Responsive

Please explain better what you need to do?

Activity icon

Replied to Compile Css And Js

You should check which libraries your template is using, and which version for each library. then install them using npm. then in your app.js, and app.scss import the scripts and styles for the libraries.

Jun
23
4 months ago
Activity icon

Replied to Eloquent Multiple Relationship Return Attributes Array

It is a belongsTo relation, it should return a Model object and not a collection

Activity icon

Replied to Eloquent Multiple Relationship Return Attributes Array

Normally you will have an model object returned, you must have something in your model that changing the default behavior.

Please post the complete code of the Sensor and Equipement models.

Activity icon

Replied to How To Add User Id When Attaching

The attach method takes a second parameter, it is an array of the additional fields you want to insert

$post->spams()->attach($request->spams, [
    'user_id' => $user_id
]);

check the docs for more info Attaching / Detaching

Activity icon

Replied to How To Convert This Raw Query Into Laravel Eloquent Way?

In order to use Eloquent you need to have a model for each table in the database and you need to define the relations between the tables in the models. but you can use the query builder to achieve similar results.

\Illuminate\Support\Facades\DB::table('ARCHIVE_LOG_SHEET_HDR')
    ->leftJoin('ARCHIVE_LOG_SHEET_PROG01', 'ARCHIVE_LOG_SHEET_HDR.LOG_ID','=','ARCHIVE_LOG_SHEET_PROG01.LOG_ID')
    ->leftJoin('ARCHIVE_LOG_SHEET_DTL', 'ARCHIVE_LOG_SHEET_HDR.LOG_ID','=','ARCHIVE_LOG_SHEET_DTL.LOG_ID')
    ->select([
        'ARCHIVE_LOG_SHEET_HDR.MATERIAL_ID as media_no',
        'SHOOT as media_type',
        '"" as media_format',
        'ARCHIVE_LOG_SHEET_PROG01.HOUSE_NO as house_no',
        'ARCHIVE_LOG_SHEET_HDR.LOG_DATE as entry_date',
        'ARCHIVE_LOG_SHEET_PROG01.FILM_NAME as program_name',
        '"" as episode_title',
        '"" as episode_no',
        '"" as last_tx',
        'ARCHIVE_LOG_SHEET_HDR.REMARKS as remarks',
        'ARCHIVE_LOG_SHEET_HDR.LOCATION_ID as shelf_no',
        'ARCHIVE_LOG_SHEET_DTL.REMARKS as short_list '
    ])->get();

Please note that this is not a working solution, it is just an example of how you might achieve what you asked for.

for more info check the documentation Database: Query Builder

Activity icon

Replied to Help Converting CURL Request Into Guzzle Request

You are not sending the headers with the get request.


$client = new Client();

$response = $client->get("https://xxxxxxx.xx.auth0.com/api/v2/users/{$userId}" ,[
    'headers' => [
        "Authorization" => "Bearer {$temp_token}",
	"Cache-Control" => "no-cache",
	"Accept" => "application/json",
    ]
]);

echo $response->getBody()->getContents();
Activity icon

Replied to Is It Possible To Be Many To Many Polymorphic?

Yes there are three types of polymorphic relations

for more info check the docs Polymorphic Relationships

May
08
5 months ago
Activity icon

Awarded Best Reply on Delete Many To Many Polymorphic Relationship

Yes it is okay to do it like this, but you are not using the relations On your Order model, i guess you should have a relation to the Product model for ex. orderable

public function orderable() {
    return $this->morphTo();
}

you can use this relation to delete any records in the relation associated with this order like this

static::deleting(function($order) {
    $order->orderable()->delete();
});