770 experience to go until the next level!
In case you were wondering, you earn Laracasts experience when you:
Earned once you have completed your first Laracasts lesson.
Earned once you have earned your first 1000 experience points.
Earned when you have been with Laracasts for 1 year.
Earned when you have been with Laracasts for 2 years.
Earned when you have been with Laracasts for 3 years.
Earned when you have been with Laracasts for 4 years.
Earned when you have been with Laracasts for 5 years.
Earned when at least one Laracasts series has been fully completed.
Earned after your first post on the Laracasts forum.
Earned once 100 Laracasts lessons have been completed.
Earned once you receive your first "Best Reply" award on the Laracasts forum.
Earned if you are a paying Laracasts subscriber.
Earned if you have a lifetime subscription to Laracasts.
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.
Earned once you have achieved 500 forum replies.
Earned once your experience points passes 100,000.
Earned once your experience points hits 10,000.
Earned once 1000 Laracasts lessons have been completed.
Earned once your "Best Reply" award count is 100 or more.
Earned once your experience points passes 1 million.
Earned once your experience points ranks in the top 50 of all Laracasts users.
Earned once your experience points ranks in the top 10 of all Laracasts users.
Replied to Restrict Form Post Data To Certain URL
Hey @bahamagician, Looks like you need a middleware where you check if the request originates from the JotForm server. If not do not process the request.
You could do this using $request->headers
Then apply this middleware for your route or on your method.
Replied to Job Chaining Mailables
@roboburo Can you try writing the new UploadInvitaionMail($model)
by using the Mail
class?
use Illuminate\Support\Facades\Mail;
Mail::to($request->user())->queue(new UploadInvitaionMail($model));
You can also push the mailable to specific queue. Example documentation
Replied to How To Sum Two Different Array If Their Name Match
@coder72 You could do something like this using collection pipeline.
use Illuminate\Support\Collection;
$first = collect([
['name' => "Mobile", 'quantity' => 18472.8],
['name' => "Laptop", 'quantity' => 20117.535000000003],
['name' => "Tablet", 'quantity' => 2609.75],
['name' => "Watch", 'quantity' =>6205],
]);
$second = collect([
['name' => "Mobile", 'quantity' => 26290.65],
['name' => "Laptop", 'quantity' => 11844.774],
['name' => "Tablet", 'quantity' => 416.8],
]);
$total = $first->merge($second)->groupBy('name')->map(function($i, $key) {
return collect(['name' => $key, 'quantity' => $i->sum('quantity')]);
});
Replied to Laravel Docx Validation Sometimes Working And Sometimes Not 422 Error
@rgabz03 Try removing the mimes:doc,docx.... validation rule and uploading file to see if it is actually issue with filetype. If the 1st one works the next one should work too unless the 2nd one is typo or incorrect extension etc. Try uploading all together different file.
Replied to Elements That Uses Js Not Working Inside V-for - Laravel-vuejs Mix
@ezmiks Please attach console errors if any. Also if the template is using jquery or alpine js make sure all required scripts are loaded.
You can also try removing vuejs and see if the issue resolves. I personally dont think it is an issue with vue. Lastly if it is an issue with vue make sure you have id="app" on you main div as per docs.
Awarded Best Reply on How To Connect And Login As An Oracle User
Replied to Multiple Approval Process In Laravel
Hey @tisuchi sorry about that. Didn't mean it in that way. I'll remove the cc. 👍
Started a new Conversation Multiple Approval Process In Laravel
Hey all!
I have the following scenario:
What is the best possible way to achieve this?
I have a table which stores all form types (form_types) and the approvals required. If approval is not required field is marked as null. Then I check the submitted form type and match the approvals required with the form_types table. And when approver acts on the request the approvals are stored in a approval table as 1:1 relation.
Ex. Approval table entry looks like:
| id | form_type_id | team_lead_approved | manager_approved | cio_approved |
| 1 | 1(A) | true | false | false |
| 2 | 2(B) | false | false | null |
| 3 | 3(C) | null (Can't act) | true | true |
Replied to Stored Session In Laravel
Hey @jessie25 did you try to dump inside the foreach loop the value of $addrList
variable? What do you get there?
Replied to Avoid Duplication
Hey @emfinanga As the error says the variable $bill_number
is not defined or getting set. Can you share the code where you set the variable $bill_number
?
Replied to Avoid Duplication
So you can do something like this:
switch(true) {
case $tambah < 10:
$bill_number = "E" . Carbon::now()->format('dmy') . "000" . $tambah;
break;
case $tambah < 100:
$bill_number = "E" . Carbon::now()->format('dmy') . "00" . $tambah;
break;
case $tambah < 1000:
$bill_number = "E" . Carbon::now()->format('dmy') . "0" . $tambah;
break;
case $tambah < 10000:
$bill_number = "E" . Carbon::now()->format('dmy') . $tambah;
break;
default:
$bill_number = 'severe';
break;
}
You can slowly start with a piece of code and try to concise it.
Replied to Auth:sanctum Middleware Causing Memory Exhausting
@omar590 Doesn't look like the error is specifically with Sanctum. Try increasing the memory_limit
in your php.ini
file?
Note: This is a temporary fix.
Something is off here. You can also debug using xdebug or other tools to check if there is a memory leak.
Replied to Maximum Execution Time Of 300 Seconds Exceeded
@jewelhuq Can you try increasing your max_execution_time
in your php.ini
file?
Replied to How To Display Data From Multi Level Categories?
@nero If I understood correctly you have a Many-to-Many relationship and want to query products based on selected category. If yes you can just do:
$products = Category::find($categoryId)->products();
Again, I am not sure if this is what you want.
Replied to Avoid Duplication
@emfinanga Its not clear what some of the lines do in the code example
foreach ($no as $idnx) {
$noo = (int) $idnx->bill_no;
}
$tambah = $noo + 1;
But you can make this code more readable and reduce LOC. You can replace this
if($request->filled('backdate')) {
$date = request('backdate');
} else {
$date = Carbon::now()->format('Y-m-d H:i:s');
}
With:
$date = $request->filled('backdate') ? request('backdate') : Carbon::now()->format('Y-m-d H:i:s');
Instead of if statements here you can use switch statement:
if ($tambah < 10) {
$bill_number = "E" . Carbon::now()->format('dmy') . "000" . $tambah;
} else if ($tambah < 100) {
$bill_number = "E" . Carbon::now()->format('dmy') . "00" . $tambah;
} else if ($tambah < 1000) {
$bill_number = "E" . Carbon::now()->format('dmy') . "0" . $tambah;
} else if ($tambah < 10000) {
$bill_number = "E" . Carbon::now()->format('dmy') . $tambah;
}
Replied to Vue JS 2.0 "div" Single Root Element Remove
@app_dev Its not clear without the code. Can you please post the component code which is throwing this error?
Or Make sure that the component is wrapped in a single div. Example
<template>
<!-- Wrapper div -->
<div>
<!-- Your html goes here -->
</div>
</template>
Replied to Email Masking
@milankyada You mean you didn't even receive email on local email server? If that's the case I am assuming there should be an error which we might be missing.
If its on actual mail server then it might be because you are sending the email on the dummy email address which obviously would bounce all over and never deliver. Hence mask the email to user but send it on the actual email address.
Replied to Email Masking
Replied to Email Masking
@milankyada Ummmm i see. Can you be more specific what didn't work for you? Were you stuck somewhere?
Replied to Filter
Hey @nacha Got you. So looks like your link goes to products controller on the index method.
So now when you die and dump this dd(\request()->get('value'))
on the index method what do you get?
Replied to Image Validation After Selecting From File Manager
Hey @rffred please provide full code from the form used to upload files and the backend code. What is the error you receive when you upload the file? If its 403 it might be due to csrf token.
Replied to Best🪡Way
Hey @konstruktionsplan ,
I think I am missing something here. You are joining the playgrounds table and the number table on playground.hash and earnings.hash. Shouldn't it be
Playground::join('number', 'playground.hash', '=', 'number.hash')->orderBy('number.id', 'DESC')->get();
Also can you post the expected answer? That will help me and others to know what you want to achieve and we could help you better.
Thanks.
Replied to Filter
Hey @nacha it is not clear where are you getting $colors
and $sizes
from. Are these passed from the controller?
Secondly, if you are getting a 404 it means the route is not defined properly. Looks like you use the url()
helper to add the links and the query params.
Can you please post your routes/web.php
file code?
You can also try to write the url like this:
url('path') . '?' . http_build_query(['param1' => 'value', 'param2' => 'value']);
<li><a href="{{ url('products') . '?' . http_build_query([ 'value' => $size->value ]) }}">{{ $size->value }}</a></li>
Note: I haven't tried this myself but used in one of my projects a long time back.
Replied to Hosting Multiple Laravel Based Web Sites
Hey @p81cfm I work with this use case of hosting multiple applications on a server at my current job. The way we have set it up is that when a request comes in through a browser nginx re-routes it to the appropriate application which are located on subfolders.
Ex.
www.xyz.com/app1
serves application from /var/www/apps/app2
www.xyz.com/app2
serves application from /var/www/apps/app2
Here is an article which explains this better. https://webdock.io/en/docs/laravel-guides/multiple-laravel-installs-subfolders-nginx-rewrite-rules-full-guide
Replied to Email Masking
I am not sure if this would be the best way to do this but you could have a pivot table email_user
which stores a random generated unique dummy email address.
With this in place you could show users the dummy email address but then while sending email send it to the actual users email obtained from the relationship.
Hope that makes sense.
Best, Prasad Chinwal
Replied to Job Dependencies
@developer makes sense. Now even I am thinking if there is a better way to do this other than using batching. If you don't mind keep me posted if you find something. :)
Replied to Job Dependencies
Hi @developer, if I understood you correctly what you need is Job Chaining. This allows you to run the jobs in a sequence. Here is the link to documentation.
Replied to Use Laravel Excel Inside Laravel Package Development
Hey @anurat try running composer dump-autoload
.
Replied to Shibboleth Authentication
Hey @diegones,
So we do have authentication set up for our Vue apps but it uses the OIDC approach. Here is the library we use oidc client.
I actually ended up building the frontend app using nuxt so to integrate it with vuex I used this library vuex oidc client.
You would not be able to authenticate your frontend using the uabookstores/laravel-shibboleth package as your vue app would only be making api calls to your lumen app. So to authenticate your frontend use the oidc client and to authenticate the backend api's use the token introspection method with this package on your lumen app laravel token introspection.