yassineqoraiche

yassineqoraiche

Member Since 2 Years Ago

Experience Points 5,230
Experience Level 2

4,770 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 36
Lessons
Completed
Best Reply Awards 1
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

05 Jun
1 week ago

yassineqoraiche left a reply on Mailable And Attach Full Path To File?

Try to use Storage::url('asamblea.pdf').

yassineqoraiche left a reply on Mailable, Rendering And AJAX

You can use maileclipse - laravel mail editor to preview and edit your mailables:

https://maileclipse.io/

23 May
3 weeks ago

yassineqoraiche left a reply on How To Override Application Config Values

@CRONIX - I'm using middleware inside a Laravel package, and it's already registered using the package service provider

public function boot()
    {
        Route::middlewareGroup('maileclipse', config('maileclipse.middleware', []));
.....

Then i set the middleware class in the package config file like this:

'middleware' => [
        'web',
        qoraiche\mypackagename\Http\Middleware\setConfigs::class
    ],

Middleware:

public function handle($request, Closure $next)
    {
        // --
        config(['mail.from.name' => 'New Name']);

        return $next($request);
    }

I do tests and the middleware registered correctly, but I still can't set config values in runtime.

the only thing that works for me is when i set config values in the service provider boot method.

yassineqoraiche left a reply on How To Override Application Config Values

in your comment, you said that to set the MAIL_FROM_NAME i need to use this code:

config(['mail.from.name' => 'New Name']);

can you tell me where I need to put this code exactly in a middleware:

Just like this?

public function handle($request, Closure $next)
    {
        // --
        config(['mail.from.name' => 'New Name']);

        return $next($request);
    }

yassineqoraiche left a reply on How To Override Application Config Values

@CRONIX - Thanks, but I try to set config values config(['key' => 'value']);using middleware before but i think i'm not doing it right, can you show me a simple example using middleware?

22 May
3 weeks ago

yassineqoraiche left a reply on "Call To Undefined Method App\Console\Kernel::job()"

I think you should just use it like this:

$schedule->job(new ServerJob("hi"))->everyFiveMinutes();

yassineqoraiche left a reply on How To Get Selected Option Value And Text In A Modal When Clicked On A Table Row

Hi, I think you just need to set an attribute in your table row with a value, then, get attribute value when modal opened and show it, hope this helps.

yassineqoraiche left a reply on Open An Registration Page In Specific Day

Probably you just need to get day name using carbon for example Carbon::now()->format( 'l' ); and check if it's Sunday then show registration form, else, return message "Sorry you can register only in Sunday", i think all this will be in a controller

yassineqoraiche left a reply on Single Code Base - Multiple Projects

Personally, I think the best way is to use git workflow (branches).

yassineqoraiche left a reply on How Do You Handle SEO In Your Apps?

I recommend using seotools Laravel package:

https://github.com/artesaos/seotools

hope this helps.

yassineqoraiche started a new conversation How To Override Config

Hi, what is the best way to override a config - in runtime - ? I want to save and config update values (eg MAIL_FROM_NAME, MAIL_FROM_ADDRESS) using an eloquent modal. is that possible

21 May
4 weeks ago

yassineqoraiche left a reply on Laravel Premium Package

@CRONIX - Yes thank you!, that's what I need, but even if Satis only support static repository?

yassineqoraiche left a reply on Laravel Premium Package

@tisuchi Generally, how to create a private package so only specific authentication method needed to install it

yassineqoraiche left a reply on Laravel Premium Package

@TISUCHI - No, i think you don't understand me, I want to sell my premium laravel package to my users how i can provide them with a private composer package to install, so other public can't install it until they pay!

yassineqoraiche started a new conversation Laravel Premium Package

How can I provide a premium package for my users like Laravel nova does, how to provide installation using private composer package ??

29 Apr
1 month ago

yassineqoraiche left a reply on How To Open/edit Blade Dynamically From Other Page

@MOUKBEL - Hi, sorry for late

can you provide me with a screenshot?

16 Apr
2 months ago

yassineqoraiche started a new conversation Create A Package For Nova

Is there a guides to create a Nova package, also i don't want to buy a license to develop packages ^^, so any free resources?

28 Mar
2 months ago

yassineqoraiche left a reply on Laravel Mail Editor (Mailables Editor) - Package

Oh a lot of Stars and Users !!

22 Mar
2 months ago

yassineqoraiche left a reply on Call To Undefined Method Illuminate\Database\Query\Builder::save()

The ->get() method will not work with Eloquent's ->save() method and you must use ->first() instead.

20 Mar
2 months ago
11 Mar
3 months ago

yassineqoraiche left a reply on Get The Value Of Submit Button

The button names are not submit, so the $request->action value is not set

09 Mar
3 months ago
08 Mar
3 months ago

yassineqoraiche started a new conversation Are You Using Mailables? Check Out This Useful Package!!

Hello laravels,

I want to introduce you to my laravel package that will make your life easier.

https://github.com/Qoraiche/laravel-mail-editor

06 Mar
3 months ago

yassineqoraiche started a new conversation Laravel Mail Editor (Mailables Editor)

Hello guys,

4 days I've created a new laravel package that allows you to preview/edit all your laravel application mailables at a single place. can you please take a look at it and give me feedback.

Package source: https://github.com/Qoraiche/laravel-mail-editor

Thanks!

12 Feb
4 months ago

yassineqoraiche left a reply on Use Custom Exception Handler In Laravel Package

@TYKUS - This is the error thrown ErrorException (E_ERROR) No hint path defined for [mail]. (View: /Users/macpro/Documents/app-maileclipse/resources/views/welcomeuser.blade.php)

throw new InvalidArgumentException("No hint path defined for [{$segments[0]}].");

yassineqoraiche left a reply on Use Custom Exception Handler In Laravel Package

@TYKUS - i don't have a custom exception, I just try to catch exception (InvalidArgumentException) from my laravel package (https://laravel.com/docs/5.7/packages).

yassineqoraiche started a new conversation Use Custom Exception Handler In Laravel Package

Hi, is there any way to add an exception handler to my Laravel package:

`public function report(Exception $exception) { if ($exception instanceof CustomException) { // }

parent::report($exception);

}`

14 Jan
5 months ago

yassineqoraiche left a reply on Mail Queue Status

@REALRANDYALLEN - @realrandyallen, @vajid thanks, but already use it, I want to implement it by myself

yassineqoraiche started a new conversation Mail Queue Status

Hello! is there any way to get the mailable queue job status (pending, processed, failed)?

08 Jan
5 months ago
05 Jan
5 months ago

yassineqoraiche left a reply on How To Get Public Class Properties (not Inhertied Ones)

@D9705996 - Actually, there is no way, because the properties showing up are not inherited, they are included from Traits (Queueable, SerializesModels). a trait is considered "compile-time copy-and-paste", so the members included from the trait are indistinguishable from those defined directly in the class. it's my mistake, i taught that the properties are "inherited" from the Mailable class but they are not. thanks btw.

yassineqoraiche left a reply on How To Get Public Class Properties (not Inhertied Ones)

@D9705996 - it's not working, it returns an empty array.

04 Jan
5 months ago

yassineqoraiche started a new conversation How To Get Public Class Properties (not Inhertied Ones)

Hi, I want to know how to get only public class properties in the Mailable class (not the inherited ones) for example:

<?php

namespace App\Mail;

use App\Mail\Mailable;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;

class TestMail1 extends Mailable implements ShouldQueue
{
    
    use Queueable, SerializesModels;

    public $name;
    
    public $body;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Build the message.
     *
     * @return $this
     */ 
    public function build()
    {
        return $this->view('emails.simpleview')->subject('New Shit');
    }
}

This class (TestMail1) inherits many properties from the extended class (Mailable), but i want only to get the name and body properties defained in the class itself

i try this:

$mailable = (new mailable1);

$data = new ReflectionClass($mailable);

$properties = $data->getProperties(ReflectionProperty::IS_PUBLIC);

$properties_in = [];

foreach ($properties as $prop) {
    if ($prop->class == $data->getName())
     $properties_in[] = $prop->name;
}

dd($properties_in);

but this returns:

array:8 [▼
      0 => "name"
      1 => "body"
      2 => "connection"
      3 => "queue"
      4 => "chainConnection"
      5 => "chainQueue"
      6 => "delay"
      7 => "chained"
    ]

Any solution?

31 Dec
5 months ago

yassineqoraiche left a reply on Strip .php From Url

@SKOOBI - you can use this regex to remove complex URL extension:

$withoutExt = preg_replace('/\.[^.\s]{3,4}$/', '', $filename);

yassineqoraiche left a reply on Strip .php From Url

@skoobi i don't understand your question, for what context you want to strip the URL?

29 Dec
5 months ago

yassineqoraiche left a reply on Install Laravel Application Without Composer

@jlrdw - thanks for the reply,

I'm just wondering what is the best method to install it manually because I'm planning to create a wizard for my users so they use it to install required dependencies and generate application key without using CLI, is there any way to do this programmatically?

yassineqoraiche started a new conversation Install Laravel Application Without Composer

Hi, what is the best way to install a laravel application manually without using composer package manager?

22 Dec
5 months ago

yassineqoraiche started a new conversation Execute Artisan Vendor:publish Programmatically

I'm trying to publish vendor mail markdown assets using the artisan command vendor:publish --tag=laravel-mail programmatically.

I try the following but not work (with no errors):

Route::get('newmailable', function() {

    $exitCode = Artisan::call('vendor:publish', [
        '--tag' => 'laravel-mail'
    ]);

    return $exitCode;

});

I'm using Laravel 5.7

21 Dec
5 months ago

yassineqoraiche left a reply on Is There A Better Way To Reference The Mailable Class Name When MessageSending Event Fires?

You can append values to the underlying swift mail class in your mailable.

Create a new mailable class to extend the parent Mailable

yassineqoraiche left a reply on How To Check Database Every Second With Laravel

I think you should write a daemon that runs via supervisord In a CLI command:

while (true) {
    doPeriodicStuff();

    sleep(1);
}

supervisord example configuration:

[program:your_daemon]
command=php artisan your:command --env=your_environment
directory=/path/to/laravel
stdout_logfile=/path/to/laravel/app/storage/logs/your_command.log
redirect_stderr=true
autostart=true
autorestart=true

Note: supervisord is needed to restart the script automatically if it fails,

yassineqoraiche left a reply on How To Get The Mailable ClassName

@D9705996 - Nice idea I will try it.

I'm creating a package that allows laravel application user to able and disable mailables.

thanks.

20 Dec
5 months ago

yassineqoraiche left a reply on How To Get The Mailable ClassName

@D9705996 - I know my friend, but is there any workaround? I want to stop dispatching a few emails before being sent, so first, I want to catch the mailable className that i want to stop.

public function handle(MessageSending $event)
    {

     if ($is_OrderShippedClass)
return false;
 }