oli_d111

oli_d111

Member Since 2 Months 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
41
Lessons
Completed
Best Reply Awards
3
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 2
8,430 XP
Mar
27
1 week ago
Activity icon

Replied to How To Throw A 404 If ID In URL Doesnt Match

Perfect thanks all. :)

Activity icon

Replied to How To Throw A 404 If ID In URL Doesnt Match

Hey @sti3bas

Thanks for your response. Currently i'm doing it like this...

public function show($unique_id)
        {
            if($unique_id === $unique_id)
            {
            	$id = Order::where('unique_id', $unique_id)->pluck('id');
	    	$order = Order::where('id', $id)->get();
	    	// etc etc
	    	return view....
	    }
            elseif($unique_id != $unique_id)
            {
                abort(404,'Page Not Found');
            }            
        }

if i use firstOrFail i get a 500 :(

Activity icon

Started a new Conversation How To Throw A 404 If ID In URL Doesnt Match

Morning All

I'm a bit stuck and was wondering if someone could offer some advice.

On my orders page, the URL shows the primary ID, as i didnt want customers to see the ID in the URL i created an additional column in the database unique_id that upon order submit generates a uniqid().

Currently i can display orders and call upon them using the unique_id however if i change any characters in the uniqid in the url i get an error 500. URL currently looks like customer/orders/5e7dace7a12cb.

Is there anyway to throw a 404 page or a custom page to tell users to stop doing things they shouldn't be?

The likelyhood of someone doing this is probably low but just trying to cater for every situation.

Thanks all.

Mar
26
1 week ago
Activity icon

Replied to Hashing ID In URL.

Ok probably not the best example on my part lol however there are other areas where i need to hash the URL.

Could anyone shed some light?

Thanks in advance.

Activity icon

Started a new Conversation Hashing ID In URL.

Afternoon all.

I hope everyone is well?

I'm looking to hash the user ID in the URL to prevent any funny business inside of the profile page.

After some googling around there appear to be a lot of different tutorials and suggestions but some are un clear on all of the steps or are missing steps from what i can tell.

I was hoping you kind folk would be able to point me in the right direction?

Currently i'm calling the page as follows:-

//View
<a class="nav-link" href="{{ route('customer-profile.show', Auth::user()->id) }}">

//Route
Route::get('customer-profile/{id}', 'Customer\[email protected]')->name('customer-profile.show');

//Controller
public function show(Request $request, $id)
{
	///
}

Of which then shows customer-profile/2 which isn't ideal.

I tried Vinkla/Hashids on this tut https://sampo.co.uk/blog/masking-ids-in-urls-using-hash-ids-in-laravel but it didnt seem to work for me. Also found Hashids/Hashids but couldnt find a good tut on it.

Any advice would be greatly appreciated.

Thanks in advance all.

Mar
25
1 week ago
Activity icon

Replied to Invoices Via Pivot Table Or Separate Table?

Hey @piljac1

That makes sense. I now understand what you mean. Not sure why i didnt get it sooner tbh.

I'll go away and have a play :)

Thank you again for all your time & help on this. I really appreciate it.

Mar
24
1 week ago
Activity icon

Replied to Invoices Via Pivot Table Or Separate Table?

Hey @piljac1

Thank you for the advice. So as i omitted the stage table in favour of a product table only.

Based on your reply am i correct in thinking that i would need a many to many polymorphic relationship between the order table & the products table which i guess is where you mentioned the orderables table instead of the order_product table?

If so would this then void the mapWithKeys function?

Also thank you for the tip on the naming convention. I will adjust accordingly. :)

Mar
23
1 week ago
Activity icon

Replied to Invoices Via Pivot Table Or Separate Table?

Hey @piljac1. Of course. I completely get it. Thank you mate & sorry if i'm causing you a headache lol.

//Orders table
-id
-user_id
-make
-mdl
-etc...

// Products table
-product_name
-product_category
-product_cost
-product_sale
-product_status
-timestamps

//order_product table
-order_id
-product_sale
-product_category
-timestamps

Let me know if you have any questions. :)

Activity icon

Replied to Invoices Via Pivot Table Or Separate Table?

Hey @piljac1 i think i definitely owe you a beer or 10 lol ;)

Thank you for this. Just trying to get my head round this as its quite a new concept to me.

As per your advice yesterday i got rid of the stages table and put all products on the Product table and defined them by category (stages / options).

Then when an order is placed, I used your mapWithKeys function to map product id, product category & product price onto the order_product table.

Out of curiosity what would be the benefit to renaming the order_product table to orderables? Also as i only have orders & order_product would i need a one to many polymorphic relationship?

Thank you in advance.

Activity icon

Replied to Invoices Via Pivot Table Or Separate Table?

Hey @piljac1 i think i definitely owe you a beer or 10 lol ;)

Thank you for this. Just trying to get my head round this as its quite a new concept to me.

As per your advice yesterday i got rid of the stages table and put all products on the Product table and defined them by category (stages / options).

Then when an order is placed, I used your mapWithKeys function to map product id, product category & product price onto the order_product table.

Out of curiosity what would be the benefit to renaming the order_product table to orderables?

Thank you in advance.

Mar
22
1 week ago
Activity icon

Replied to Invoices Via Pivot Table Or Separate Table?

Hey @piljac1

Sorry to ask another question, i've just not done anything like this before.

Going back to your getTotalCostAttribute() in the Order Model,

I've got...

// Order Model
function getPriceAttribute() 
    {
        return $this->products->sum('product_sale');
    }

Would this automatically look at the order_product pivot table?

Also whats the best way to call the data in the view? Currently i'm getting an error of App\Order::getPriceAttribute must return a relationship instance. when i use the following in the view.

@forelse($filereqP as $pending)
	<td>...</td>
	<td>...</td>
	@foreach($pending->getTotalCostAttribute as $total) 
		<td>{{ $total }}</td>
	@endforeach
@endforelse

Thank you again in advance dude.

Activity icon

Replied to Laravel Booking, Appointment Course?

Ah sorry, i must have misread. If its a tut your after, i found this on google which may help. Not sure how you feel about Angular? https://medium.com/@andreaterzani/hotel-booking-engine-with-laravel-5-and-angularjs-part-1-81af69432b1a

Or theres this one... https://projectworlds.in/free-projects/php-projects/online-hotel-booking-system-in-php-laravel/

Activity icon

Replied to How To Insert Into Pivot Table

Thanks for the code.

Have you got a pivot table that sits between the Prices table & Services table? If not, aprice_service pivot table is what you'll need. The pivot table will need 2 columns, service_id & price_id

Then in your Service Model, your relationship of hasOne('App\Price'); will need to correspond with the Price Model with belongsTo('App\Price');.

Then in your controller you just need to modify your attach method to something like:-

$service->price()->attach($service['price'];

Activity icon

Replied to Laravel Booking, Appointment Course?

Hey @ivanradojevic

It looks as though you didn't search "the whole web" ;)

A quick google search revealed this...

https://github.com/LaravelDaily/Hotel-Booking

Is that what you're looking to do? Maybe you could clone the repo and modify to suit your needs?

Activity icon

Replied to How To Display Products With Checkbox(products Related To Color ,size And Brand :filters)

I could be wrong but this sounds like you would require Ajax. Unfortunately it's not my strong suit so hopefully someone more knowledgeable on the subject will come along soon.

Activity icon

Replied to How To Insert Into Pivot Table

Hi @hjortur17

Are you able to show your store or update function in your controller aswell?

Have you got a pivot table that sits between the two?

In your price model, do you have a belongTo relationship to the Service::class?

Activity icon

Replied to Blank Value For Order / User Relationship

Hey @tomspeak yeah i think my syntax was incorrect.

I was trying to obtain the product category but my syntax was off. It should have been...

@forelse($complete->products as $product)
	@if($product->product_category == 'eg-category')
		<p>{{$product->product_name}}</p>
	@endif 
@empty
<div class="row justify-content-center"></div>
    <div class="col-md-12">
        <h5>No Options Selected</h5>
    </div>
@endforelse	
</div><!-- end row -->

Thanks All.

Activity icon

Replied to Blank Value For Order / User Relationship

Thanks @snapey & @shez1983 for your advice.

The issue was as @snapey said so i opted to attach the user id to the order_user pivot table at time of order.

Side note...on the subject of statements, i had a look through the laravel docs but couldn't see... is it possible to display a variable if it matches a string? i.e

@if($product == 'some-string')
	/// Variable here
@endif
Activity icon

Replied to Blank Value For Order / User Relationship

Hey @snapey thanks for your response.

Interesting point, i would have thought that User hasMany Order and Order belongsToMany users as many users have many orders.

Nevertheless, i've switched it up as per your recommendation and my order table does include a user_id but i'm now getting an error of Invalid argument supplied for foreach()

@foreach($pending->users as $user)
    <td>{{$user->company_name}}</td>
@endforeach

I think i've been staring at this too long to see it lol. What am i missing? I've checked it against other foreach loops i've got :/

Thanks in advance.

Activity icon

Started a new Conversation Blank Value For Order / User Relationship

Morning All

I think i'm having a complete mind blank but i'm getting an empty value when i try to call the users data from the Order table.

In my Order model i've got:-

public function users()
{
    return $this->belongsToMany(User::class);
}

& in my User model i've got

public function orders()
{
    return $this->hasMany(Order::Class);
}

In my order controller i've got:

$filereqP = Order::where('stage', 'pending')->with('users')->get();

& in the view when i try to call the following

@forelse($filereqP as $pending)
<td> </td.......
       @foreach($pending->users as $user) 
            <td>{{$user->company_name}</td>
       @endforeach
<td> </td.......
@endforelse

But it doesnt return the company name from the users table. Is it because i'm trying to call an @foreach inside of a @forelse loop?

Thanks in advance.

Activity icon

Replied to Invoices Via Pivot Table Or Separate Table?

Wow, mapWithKeys is an awesome little feature i wasn't aware of but was exactly what i needed. Using this i've added a couple of extra columns which was a breeze with mapWithKeys. :)

Thank you for your help on all of this dude, i really appreciate it.

Mar
21
1 week ago
Activity icon

Replied to Invoices Via Pivot Table Or Separate Table?

Awesome thanks @piljac1. I think i'm starting to get it now. That makes a lot of sense and would make it easier all being in the orderables table.

So currently, following the above my order form now writes to the Order table and attaches the product_id and the order_id to my order_product table.

However the bit that im confused about is how would i pull the price data from the order form when im using the ID of the product to write to the order_product table?

I tried hidden input fields but it went horribly wrong lol.


$form_data = array(

    'make'           => $request->make,
    'mdl'              => $request->mdl,
    'mdl_year'    => $request->mdl_year,
    'option_id'    => $request->option_id,
    'user_id'        => $request->user_id,
);
// dd($form_data);
$order = Order::create($form_data);
$order->products()->attach($form_data['option_id']);
<div class="row">
    @foreach ($stage as $stage)
        <div class="col-md-4 padb-10 pull-left">
            <span class="badge badge-success">£{{ $stage->product_sale }}</span>
            <input type="checkbox" name="option_id[]" value="{{ $stage->id }}"> {{ $stage->product_name }}
            <input type="hidden" name="option_value[]" value="{{ $stage->product_sale }}"> 
        
        </div><!-- end col -->
    @endforeach
</div><!-- end row -->
</div><!-- end text-center -->
<div class="padb-20"></div>
<hr class="dotted short">
<!---------------------------------START: ROW TWO --------------------------------->
<div class="">
<label class="text-secondary text-center">Optional Extras<br></label>
        <div class="padb-10"></div>
<div class="row">
    @foreach ($options as $option)
        <div class="col-md-4 padb-10 pull-left">
            <span class="badge badge-primary">£{{ $option->product_sale }}</span>
            <input type="checkbox" name="option_id[]" value="{{ $option->id }}"> {{ $option->product_name }}
            <input type="hidden" name="option_value[]" value="{{ $stage->product_sale }}">
        <br>
        </div><!-- end col -->
    @endforeach
</div><!-- end row -->

Really appreciate your help on this dude.

Activity icon

Replied to Invoices Via Pivot Table Or Separate Table?

Hey @piljac1 @pom

Thank you both for your reply's.

I think i'm over complicating it or i'm just totally confused lol.

Where i'm trying to get to is a point that i can get the total so that i can integrate a payment gateway to charge the customer using something like Worldpay (preferably) /Snipcart etc.

Here's where i'm currently at. On my order form (writes to order table), i have a few input fields and a few option fields...

the option fields are:-

<label>Select Main Option<sup>*</sup></label>
  <select required type="text" name="stage_id" class="form-control" >
     <option></option>
       @foreach ($stage as $stage)
          <option value="{{ $stage->id }}">{{ $stage->stage_name }}</option>
       @endforeach
  </select>

 <label class="text-secondary text-center">Optional Extras<br></label>
     <div class="row">
          @foreach ($options as $option)
          <div class="col-md-4 padb-10 pull-left">
               <span class="badge badge-primary">£{{ $option->product_sale }}</span>
               <input type="checkbox" name="option_id[]" value="{{ $option->id }}"> {{ $option->product_name }}                                        		 
           </div><!-- end col -->
          @endforeach

On my controller i have:-

$form_data = array(

    'mdl_year'        => $request->mdl_year,
    'option_id'       => $request->option_id,
    'stage_id'        => $request->stage_id,
    'make'            => $request->make,
    'mdl'             => $request->mdl,
    'user_id'         => $request->user_id,
);

$order = Order::create($form_data);
$order->products()->attach($form_data['option_id']);
$order->stages()->attach($form_data['stage_id']);

Model info for reference...

// Order model has:-
public function products()
    {
        return $this->belongsToMany(Product::class);
    }

// Product model i have:-
public function orders()
    {
        return $this->belongsToMany(Order::class);
    }

//Stage model
 public function orders()
    {
        return $this->belongsToMany(Order::class);
    }

Which inputs the form data into the order table, the order id & product id into the order_product pivot table & the order id & stage id into the order_stage pivot table. I guess this is maybe where i need a polymorphic many to many table :/

So i guess my question is, would it be simpler to also insert the product id & product value & stage id into the order_product pivot table in order for me to get the total value later using the public function getTotalCostAttribute()

I apologise for the code dump, its just i wanted to show all of it so that it would be easier for you to see. Also i'm still quite new to Laravel and trying to get my head round this part so that i can get the total value so that i can integrate a payment gateway.

If i'm going in completely the wrong direction with this please also let me know lol :)

Massive thank you in advance & if you have any questions let me know.

Mar
20
2 weeks ago
Activity icon

Replied to Invoices Via Pivot Table Or Separate Table?

Hey @piljac1 thanks for your response.

I've not done any polymorphic relationships before so will read up on that.

You mentioned adding an attribute on the invoice model to manage the calculation but i dont understand how you would do that or why you wouldnt just do it in the controller and then input the value to the database?

Please can you confirm.

Thanks in advance.

Activity icon

Replied to Count All Values Before Inserting Into Database...

I guess another question i should be asking is how do i calculate the total if the checkbox is checked?

Would this be better done in the view with JS/Jquery to create a total and then pull that into the controller on submit?

I'm a bit stuck on this one so any advice would be greatly appreciated.

Mar
19
2 weeks ago
Activity icon

Replied to Count All Values Before Inserting Into Database...

Hey @deansatch

Thanks for your response. I've not used array sum before, would it be like this?

$optionTotal = array_sum($product_value);
        dd($optionTotal);
Activity icon

Replied to Laravel MS Office Files Upload Validation

I could be missing something but surely the MIME type would come under file type not file name?

Activity icon

Started a new Conversation Count All Values Before Inserting Into Database...

Evening All

I hope you're all well considering everything that's going on.

Im looking for a little advice on where i'm going wrong. In my view, i have a few options that are outputted into via a foreach loop. Then when the form is submitted i want to total all of the monetary value of the options and insert into the database. I'm using collections but i seem to keep getting a result of zero.

Please can someone advise where i'm going wrong...

View:

 @foreach ($options as $option)
      <div class="col-md-4 padb-10 pull-left">
             <span class="badge badge-primary">£{{ $option->product_sale }}</span>
              <input type="checkbox" name="option_id[]" value="{{ $option->id }}"> {{ $option->product_name }}
              <input type="hidden" name="product_value[]" value="{{ $option->product_sale }}">
              <br>
      </div><!-- end col -->
@endforeach

controller:

$form_data = array(

            'make'            => $request->make,
            'mdl'             => $request->mdl,
            'mdl_year'        => $request->mdl_year,
            'option_id'       => $request->option_id,
);

 $optionTotal = new Collection([
            'product_value' => array($request->product_value),
        ]);
        
        
        $sum = $optionTotal->sum();
        dd($sum);

Thank you in advance.

Mar
15
2 weeks ago
Activity icon

Replied to Invoices Via Pivot Table Or Separate Table?

So i'm finally getting around to this & just had a couple of questions.

Currently i have the following tables.

-Order -Product -Order_Product (Pivot) -Service -Invoice -Invoice_Items (Pivot)

Now the product table offers products & the service table offers services. Both of which have a monetary value to them and both having a belongToMany relationship to the Order table.

Because of this i'm slightly confused in the fact that would i be able to use the invoice_items table for pivoting the values of the Services & Products?

And secondly, when i update the order from pending to complete, how would i add all of the products and services to give a total monetary value for the invoice table?

Thank you in advance.

Mar
14
2 weeks ago
Activity icon

Replied to Firing An Event Depending On User Input...

Legend. Thank you :)

Activity icon

Replied to Firing An Event Depending On User Input...

Quick question...

In my controller ive got the following array so that i can call the data in the listener.

 $customer = [
            'email' => $request->email,
            'id'    => $request->id,
        ];

& in my listener i've got:

Mail::to($event->customer->email)->send(new AccountApprovedMail());
User::findOrFail($event->customer->id)->notify(new AccountApproved());

But i'm getting an error of: Trying to get property 'email' of non-object.

Please can you advise where i'm going wrong?

Thanks in advance.

Activity icon

Replied to Firing An Event Depending On User Input...

Hey @rodrigo.pedra thank you for your suggestion. I wasn't aware you could do it like that but its exactly what i'm looking to do.

Appreciate the help. Cheers dude.

Activity icon

Started a new Conversation Firing An Event Depending On User Input...

Morning All

I'm trying to figure out the best way to fire an event such as an email depending on which value admin has chosen.

Essentially, what i'm trying to do, is when a customer applies for an account, admin can either approve or reject the account. I was hoping to fire an event based on that response. So if admin selects approved from the dropdown it sends an email to the user saying he's been approved etc. However if admin chooses to reject the account it fires another email saying something like sorry etc....

I'm comfortable with events and listeners but trying to work out the best way to do this. I thought of maybe having 2 functions one to handle each event but then i would have to change the form and would lose the dropdown.

Please can someone advise the best way to do this.

Thanks in advance.

Mar
13
3 weeks ago
Activity icon

Replied to Routing Issue When User ID Is In URL...

I just realised. Its because I'm not using a leading / in my anchor tags.

Doh!....

Thanks dude :)

Activity icon

Replied to Routing Issue When User ID Is In URL...

Hey @sinnbeck

Sure, its <a class="nav-link" href="dealer-dashboard">.....

Activity icon

Started a new Conversation Routing Issue When User ID Is In URL...

Hi All

I'm just working on the user profile page and i have a weird issue that i can't figure out.

When i select the user profile page, the page loads and gives me the URL of eg... ...dealer-profile/2

However when i click to navigate to another page...say dashboard, it tries to add the URL of the existing URL so it ends up as dealer-profile/2dashboard

The way i've got it set up is Navbar:

<a class="nav-link" href="{{ route('dealer-profile.show', Auth::user()->id) }}">
	<i class="fas fa-user-cog" aria-hidden="true"></i>
	<span>Profile</span>
</a> 

& my route is:

Route::get('dealer-profile/{id}', 'Dealer\[email protected]')->name('dealer-profile.show');

I tried adding a / after {id} but no joy.

Please can someone advise how i would go about resolving this?

Thank you in advance.

Activity icon

Replied to How Do I Remove A Laravel Nova Theme?

Like what? Can you not just change the CSS and clear the cache?

Activity icon

Replied to How To Upload Randomly File From Local

Hey @spiral did you manage to get it sorted?

If so please can you mark my answer as "Best Answer" to close the thread.

Mar
12
3 weeks ago
Activity icon

Replied to I Can't Seem To Login Or Register Anymore

The error you received should show you where it’s expecting a closing parentheses.

If it’s not obvious on the preview panel on error page, click the application tab and the first link underneath and it should highlight the line in question in red.

Mar
11
3 weeks ago
Activity icon

Replied to Service Injection Object Error

Hey @sinnbeck i figured out a solution. I think maybe the $casts was affecting the id in the notifications table as it was converting it from char to an int which was why it couldn't update the record.

In anywise i added another column to the database as a UNIQUE column with an auto incrementing id and this seems to have done the trick.

Thanks again for your help. :)

Activity icon

Replied to How To Upload Randomly File From Local

Hey @spiral

As @ftiersch said, the user needs to upload the file in a form. This is normally done via an <input type="file" id="file" name="file">

The controller would then take the file and you would specify the path in which to place the file for safe keeping. After that you would extract the file name and write the file name to one of the columns in your database. (You wouldn't normally store it directly into the database.)

To call upon the file you would send the data from the controller to the view file and then place an anchor tag so that the user can download. Something along the lines of

<a download href="{{ URL::to('/') }}/yourfolder/{{ $yourvariable->column_name }}">Download</a>

Did you check out the tut i sent a link for earlier?

Activity icon

Replied to Service Injection Object Error

Bizarrely in the attributes the ID shows when i do a @dd()

#attributes: array:8 [▼
        "id" => "b51907d3-b342-47cc-bb5b-0832dea48101"
        "type" => "App\Notifications\NewFile"
        "notifiable_type" => "App\User"
        "notifiable_id" => 1
......
Activity icon

Replied to Service Injection Object Error

Sorry one last question....

The ID isn't appearing in the foreach loop. Is there something different i need to do?

@foreach($notify->getUnread() as $notification)
     <input type="text" name="id" value="{{ $notification->id }}">

But i'm getting a value of 0. :(

The input is part of a hidden form that is used to update the status as read.

Activity icon

Replied to Service Injection Object Error

Amazing thank you @sinnbeck. Really appreciate your help. $casts seems to have solved the last issue.

Thanks again.

Activity icon

Replied to Service Injection Object Error

It does indeed :)

However please bear in mind that all of the data is stored into one column like this....

"data" => "{"text":"New Request","make":"Ford","model":"F150","company":"The Company","user_id":"2","image":"form.png"}"

I'm just using Laravels Notifications system

Activity icon

Replied to Service Injection Object Error

Weirdly page was still stuffed but managed to get this:-

Illuminate\Database\Eloquent\Collection {#505 ▼
  #items: array:1 [▼
    0 => App\Notification {#515 ▼
      #table: "notifications"
      #connection: "mysql"
      #primaryKey: "id"
      #keyType: "int"
      +incrementing: true
      #with: []
      #withCount: []
      #perPage: 15
      +exists: true
      +wasRecentlyCreated: false
      #attributes: array:8 [▶]
      #original: array:8 [▶]
      #changes: []
      #casts: []
      #dates: []
      #dateFormat: null
      #appends: []
      #dispatchesEvents: []
      #observables: []
      #relations: []
      #touches: []
      +timestamps: true
      #hidden: []
      #visible: []
      #fillable: []
      #guarded: array:1 [▼
        0 => "*"
      ]
    }
  ]
}
Activity icon

Replied to How To Upload Randomly File From Local

Have you got created a form yet?

Check out the many tutorials available on google such as: https://quickadminpanel.com/blog/file-upload-in-laravel-the-ultimate-guide/

Activity icon

Replied to How Do I Remove A Laravel Nova Theme?

instead of removing Nova and or the CSS why don't you make a custom.css file and overwrite the properties?

Activity icon

Replied to Service Injection Object Error

Strangely it just kills the page and only loads everything before the @dd but doest echo the data.