Hala

Hala

Member Since 8 Months Ago

Experience Points
11,030
Total
Experience

3,970 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
86
Lessons
Completed
Best Reply Awards
0
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 3
11,030 XP
Sep
16
2 days ago
Activity icon

Replied to One To Many Selector Packages In Nova

No , this will let me create a new record ,

i mean i want sth like select which let me select bunch of countries and update theme_id of it once

Sep
15
3 days ago
Activity icon

Started a new Conversation One To Many Selector Packages In Nova

Hello i have i have one to many relation i have one theme related to many countries , is there any package could i select multi countries to that theme in theme resource?

Sep
05
1 week ago
Activity icon

Started a new Conversation Authorization Fail

but the test pass as status 200 not 403

Aug
30
2 weeks ago
Activity icon

Replied to Nova Tool ,doesn't Added Data In Database

Thank you , yes everything was correct , i figure out my problem i just order my data database in ASC :)

Activity icon

Started a new Conversation Nova Tool ,doesn't Added Data In Database

Hello i have a nova tool when i make anova request to post data , the data have been received successfully ,

but the database not save it

here is my Controller method

public function comment(Request $request)
{
    Validator::make($request->all(), [
        'body' => 'required',
        'post_id' => 'required',
    ])->validate();


    Comment::create([
        'user_id' => User::inRandomOrder()->first()->id,
        'post_id' => $request->post_id,
        'body' => $request->body
    ]);

    return responder()->success([
        'status' => 'success'
    ]);
}
Aug
26
3 weeks ago
Activity icon

Replied to Convert Created_at To Date Type

@michaloravec thank you , but i want to save it as datetime and return it with api as date

Activity icon

Started a new Conversation Convert Created_at To Date Type

Hello , i try to cast created_at to be date i added this in the model

protected $casts = [
    'created_at' => 'date'
];

  protected $casts = [
    'created_at' => 'date:Y-m-d',
];

but did not work it's return back as datetime

Aug
15
1 month ago
Activity icon

Started a new Conversation Added Data To Nova Request

how could i added data in nova request to be created with out set fields in Fields method

i mean as append but not added input to admin to fill them

Aug
07
1 month ago
Activity icon

Replied to Override Nova Resource

@bobbybouwmann

Sorry if my explanation was not that clear

in food model i have two columns one is the name and other is type

i have 4 types each type is a resource in nova and it's work pretty , and i was having index query method as yours

but the problem is when i create Holy meal record , in the db the creation save the type as cuisine not the correct type , so how could i make it save type as the name of resource

Activity icon

Started a new Conversation Override Nova Resource

I have Food Model

the food has 4 type in database

in nova i make for each type a resource

so i have Class cuisine Food , Class holy_meal Food and so on

when i create holy meal the type fill in db as cuisine

how could i have same type as his class name

Jul
25
1 month ago
Activity icon

Replied to HTMLPurifier Allow Target Blank

Hello @coxy121 , it was from 2 months ago , and i found what you did do

Thank you so much

Jul
22
1 month ago
Activity icon

Replied to SoftDelete & Observer

thank you , but nope update in observer not working even when i make new query

i used forcefill instead of update and it's work , i think because of soft delete,

Jul
21
1 month ago
Activity icon

Started a new Conversation SoftDelete & Observer

Hello i have this test when and want to make observer to update it

 /** @test * */
public function it_should_change_status_order_when_traveller_delete_order_using_api_v1()
{
    $this->loginAs('traveller', $this->traveller);

    $this->deleteJson(route('api.v1.order.delete', [
        'order' => $this->order->id
    ]))->assertStatus(200);

    $this->assertEquals(-1, $this->order->status);
}

Observer

 public function deleted(Order $order)
{
    Order::onlyTrashed()->find( $order->id)
        ->update([
            'status' => -1
        ]);
}

well the test run the observer but the assert fails and not updated ,

Jun
30
2 months ago
Activity icon

Replied to Type Hint Return Empty Model

the model is empty so it will not be updated , i try it without type hint and it's work

Activity icon

Replied to Type Hint Return Empty Model

when i make $staff->fill($request->all())

it creates new record in database

Activity icon

Replied to Type Hint Return Empty Model

oh my mistake, but also it's return empty model

Activity icon

Started a new Conversation Type Hint Return Empty Model

I have this route

   Route::put('update/{staff}', '[email protected]');

and this is the method

            public function update(Staff $staff, Request $request)
                 {

                  }

when i dd($staff) , it's return empty model

Jun
24
2 months ago
Activity icon

Started a new Conversation Nested Relation In Nova "with Pivot " Resource

I have Order model , Country model and city model

order belongs to many country so i can show up all countries in order resource

and country of this order has many cities in another table

how could i show up these cities of the order since the relation is nested

Jun
23
2 months ago
Activity icon

Replied to Nova Disable Attach On Belongs To Many

@bobbybouwmann

Thank you , yes it works , one of these policies was having before method with override these things

Activity icon

Replied to Checking Condition In Construct

@michaloravec Thank you so much , i solved it

Jun
22
2 months ago
Activity icon

Replied to Checking Condition In Construct

the class it's an package so i need to check if it's the same user ignore it

Activity icon

Replied to Checking Condition In Construct

well i'm going to check the id of User if it's what right i want to move on in the class

if not i do not want to make a reacord from this class in db

Activity icon

Started a new Conversation Checking Condition In Construct

i have a construct i want to check an condition in it and get out of class if it was true

i try return but did not work

Jun
21
2 months ago
Activity icon

Replied to Nova Disable Attach On Belongs To Many

@bobbybouwmann

well i have Order model and Theme model they are many to many

this is Order policy

public function attachTheme(Order $order, Theme $theme)
{
    return false;
}

and this is Theme policy

public function attachOrder(Order $order,Theme $theme) 
{
    return false;
}

and this is the relation in Order model

public function Themes()
{
    return $this->belongsToMany(Theme::class);
}
Activity icon

Replied to Nova Disable Attach On Belongs To Many

i define the polices and the relation but nothing change i try to non display view icon and it's work but the attach did not work

Activity icon

Started a new Conversation Nova Disable Attach On Belongs To Many

Hello , i have rescorce having many to many with another model how could i disable editing on it just view relation with out attach or detach it

Jun
20
2 months ago
Activity icon

Started a new Conversation Testing

test

Jun
10
3 months ago
Activity icon

Started a new Conversation Test

test

Jun
08
3 months ago
Activity icon

Replied to Moving Image From Public Folder To Storage

well i have some fixed images i try to add them manually on public folder and save the path during seeder , but the image did not show up

Activity icon

Started a new Conversation Moving Image From Public Folder To Storage

I have some image in public , and i want to move them from public to storage by seeder and save the path in database

how could i get files and move them

Jun
07
3 months ago
Activity icon

Started a new Conversation Validation Array Of Values

Hello , i have this Validation rule

public function rules()
{
    return [
        'notification_id' => ['required', 'array'],
        'notification_id.*' => ['integer', "required_if:notification_id.size,>,0"],
        'read' => ['sometimes', 'boolean'],
        'highlighted' => ['sometimes', 'boolean']
    ];
}

well how could i validate values of the array if it has , and non check them if array was empty i try required if but it does not work

Jun
06
3 months ago
Activity icon

Started a new Conversation Saving Image In Public Directory Using Seeder

how could i saving image from storage to public directory using seeder

May
20
3 months ago
Activity icon

Started a new Conversation Array Of Object In Request

i have this part of test , and i try to send documents as array of object not array of array , i used json decode ,Object() and did not work any idea?

        [
      
            'documents' => [
                [
                    'document' =>Str::random(),
                    'label' => $label = 'new Document'
                ],
                [
                    'document' => Str::random() 
                ],
            ]

        ]
    )->assertStatus(201);
May
18
4 months ago
Activity icon

Replied to Json Structure

Thank you for your help

Activity icon

Started a new Conversation Json Structure

/** @test * */

public function planner_can_get_his_destinations_Cities_with_his_profile_via_api_v1()
{
    $this->loginAs('planner', $this->planner);

    $cities = factory(City::class)->create()->id;

    $this->planner_destination->Cities()->attach($cities);

    $response = $this->getJson(
        route('api.v1.planner.profile', [
            'planner' => $this->planner->id,
            'with' => [
                'destinations.cities'
            ]
        ])
    )->assertStatus(200);

    $data =$response['data']['destinations'][0];
    $city=$data['cities'][0];

    $this->assertEquals($city['city_id'], $this->planner_destination->Cities->city_id);
    $this->assertEquals($city['planner_destination_id'], $this->planner_destination->Cities->planner_destination_id);
}

i have this test , i want to make sure that response contain cities , how can i get data from json without write it statically

this is json i recieved , i know it contains cities but i can't get them from it

{ "data":

{

"id":1,

"email":"[email protected]",

"destinations":[ {

"id":1,

"cities":[ { "id":1," planner_destination_id":1, "city_id":1 }]

}]

}}

May
17
4 months ago
Activity icon

Started a new Conversation Load Nested Relation In API Resource

i have User recourse and want to load nested relation in it how can i use that without use property $with since i need to load relation when it's present

Activity icon

Replied to Nova Https

yes , it works fine, thank you but still nova color of navbar on https different than http

Activity icon

Replied to Nova Https

i have it already

Activity icon

Started a new Conversation Nova Https

how can i add nova https for links in nova since this error appear

The page at***** was loaded over HTTPS, but requested an insecure stylesheet 'http://theme/theme.css'.

May
13
4 months ago
Activity icon

Replied to Query In Field

thank you a lot , yes it works now ,

Activity icon

Replied to Query In Field

well i need to know how many question in each tag in index page

yes i'm in Tag Resource

i used indexQuery method before and it was fine but now i have many queries to do

and i don't want to use lens or actions

Activity icon

Replied to Query In Field

well yes ,i used this in index Query method but now i need more than relation so i can not use it , when i used this return fixed value , so i was looking how to query in fields not lens or filter

Activity icon

Started a new Conversation Query In Field

i want to make query in fields i used this but it's return fix value in resource

Number::make('Name' , function () { return \App\Tag::query()->with('questions')->count() }),

May
12
4 months ago
Activity icon

Replied to Nova Package For Sorting

YES ,thank you i have already index query method

Activity icon

Replied to Nova Package For Sorting

yes, and i'm able to sort rows but as fronted, once i refresh the order will reset

Activity icon

Started a new Conversation Nova Package For Sorting

Hello i searching for a package can sort rows and effect it on database i use this but there is no effect on database column any suggestion

https://github.com/optimistdigital/nova-sortable

May
07
4 months ago
Activity icon

Started a new Conversation Search For Value In Many Column

I have value want to search it in two columns

i used this

User::where('price',$value)->orwhere('total_price',$value)

is there any good method rather than this

Activity icon

Replied to HTMLPurifier Allow Target Blank

Thank you, but i need to stick with the package i used

Activity icon

Replied to HTMLPurifier Allow Target Blank

I checked them before did not work only target work if i added 'HTML.TargetBlank'=>true,