Coursecomp is your starting point for developing and maintaining your web application.
In previous post, we showed how to make gradient border with CSS. This time, we go a little bit further. Let’s take a look at the beautiful button “Start coding” on Codepen.io homepage (you have to be logged out to see it). It also animates beautifully on mouse over: Here you are, beautiful button: See […]
The border-image-source property allows you to set a trendy gradient for the element’s border. Try it on Codepen. Remember, this code does not work with the border-radius property because it is not supported with border-image. If you want to have rounded borders, you can try this code: See Codepen
Laravel tip. You can use the whereRelation method (introduced in Laravel 8.57+) instead of whereHas when filtering by a simple where statement. The only downside is that you cannot use scopes, whereRelation is suitable for only one simple “where” statement. The merit of using whereRelation is shorter and more readable syntax, and in terms of […]
Did you know that you can put some conditional validation rules in your Laravel form requests? If you use Inertia, you can also switch from your Javascript validation to server-side validation with Form requests. Works like a charm.
Laravel is a very flexible framework, and you can reutilize your Blade components when it comes to SVG rendering. You can use {{ $.attributes }} in the component itself to pass custom attributes like (e.g., “class”). Just look at the following syntax: File structure: Helpful tip If you see the use of href="#!" and have […]
Eloquent is a brilliant ORM – you can use conditions in relationships. In this example, we have multiple users. In the next step, we set a relationship called admins which extends the user relation with a condition. So easy! But you have to be mindful when creating a user via admins relationship. You will need […]
Here is the cheat sheet on the ways you can push jobs to queue in your Laravel application: If you are configuring Laravel Queues with AWS SQS, and you want to queue a job later than 15 minutes in the future, you may want to use the Laravel Haystack package. You can also use the Bus::chain method […]
You can easily change case of the translated variables with Laravel (uppercase, lowercase, first letter capitalized). See the following code: From @ecrmnn
It is very common when you have to check whether a string is a valid JSON or not. An example of Str::isJson in Laravel In Laravel, you may want to use Str::isJson method as follows: These are examples from the official documentation: What is JSON for? JSON is a data format that helps exchange data […]
This is so good! The only thing that feels wrong is the empty brackets. What is a constructor property promotion? It is a new syntax that PHP 8 brings, allowing two simultaneous operations: Class property declaration and Constructor assignment, right from the constructor. See how it works: See the official documentation.