omarsow94

Experience

3,350

0 Best Reply Awards

  • Member Since 1 Year Ago
  • 3 Lessons Completed
  • 0 Favorites

23rd July, 2018

omarsow94 left a reply on {{ Asset('') }} In Javascript • 2 months ago

I was missing the jquery cdn link its work, my bad

omarsow94 left a reply on {{ Asset('') }} In Javascript • 2 months ago

i use the SLIDER REVOLUTION SCRIPTS plugin @Cronix

omarsow94 left a reply on {{ Asset('') }} In Javascript • 2 months ago

I try starting witha / but nothing change @Cronix ... yes i try to load /public/rev-slider-files/js/

omarsow94 started a new conversation {{ Asset('') }} In Javascript • 2 months ago

Hello, i have this function in my javascript file...

revapi54 = tpj("#rev_slider_54_1").show().revolution({
                    sliderType: "standard",
                    jsFileLocation: "rev-slider-files/js/",
                    sliderLayout: "fullwidth",
                    dottedOverlay: "none",
                    delay: 9000,
                    ....

And jsFileLocation did not find the target. Someone help me please ?

17th July, 2018

omarsow94 left a reply on Log With Matricule • 3 months ago

Yes i did that . Thanks you

omarsow94 started a new conversation Log With Matricule • 3 months ago

I have a column called matricule its uniq, in my user table , i would like to log with matricule not username or email ... A need help

10th June, 2018

omarsow94 left a reply on Remember User • 4 months ago

It work i change the value on lifetime in config/session.php

omarsow94 started a new conversation Remember User • 4 months ago

Hi, i would like to custom AuthenticatesUsers.php to remember user where he log in. I have no idea .

8th June, 2018

omarsow94 left a reply on Send Notification • 4 months ago

@Sergiu17 it's empty

omarsow94 left a reply on Send Notification • 4 months ago

It's work in locale with mailtrap but not on production with host informations

omarsow94 left a reply on Send Notification • 4 months ago

I do @Sergiu17 :

  /**
     * Create a new user instance after a valid registration.
     *
     * @param  array  $data
     * @return \App\User
     */
    protected function create(array $data)
    {
        $user =  User::create([
            'username' => $data['username'],
            'email' => $data['email'],
            'password' => bcrypt($data['password']),
            'token' => str_random(25),
        ]);

        $user->sendVerificationEmail();

        return $user;
    }

omarsow94 left a reply on Send Notification • 4 months ago

@Sergiu17 i used , make:notification ,

<?php

namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use App\User;

class VerifyEmail extends Notification
{
    use Queueable;

    public $user;

    /**
     * Create a new notification instance.
     *
     * @return void
     */
    public function __construct(User $user)
    {
        $this->user = $user;
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return ['mail'];
    }

    /**
     * Get the mail representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return \Illuminate\Notifications\Messages\MailMessage
     */
    public function toMail($notifiable)
    {
        return (new MailMessage)
                    ->line('Veillez vérifier votre email pour continuer.')
                    ->action('Verification email', route('verify', $this->user->token))
                    ->line('Merci à vous!');
    }

    /**
     * Get the array representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function toArray($notifiable)
    {
        return [
            //
        ];
    }
}

.env file

MAIL_DRIVER=smtp
MAIL_HOST=ssl0.ovh.net
MAIL_PORT=465
[email protected]
MAIL_PASSWORD=password
MAIL_ENCRYPTION=SSL

omarsow94 left a reply on Send Notification • 4 months ago

@mvd i don't find this function . Where is this function ?

omarsow94 left a reply on Send Notification • 4 months ago

@arukomp how can i do that in production ?

omarsow94 started a new conversation Send Notification • 4 months ago

Hello, i try to send notification when user registered. So i have all informations good (.env file and config/mail.php ) but nothing happen . No mail sended

.env


MAIL_DRIVER=smtp
MAIL_HOST=ssl0.ovh.net
MAIL_PORT=465
[email protected]
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=SSL

config/mail.php

  'from' => [
        'address' => env('MAIL_FROM_ADDRESS', '[email protected]'),
        'name' => env('MAIL_FROM_NAME', 'Cheikh Omar'),
    ],

omarsow94 left a reply on Send Notification • 4 months ago

@arukomp

MAIL_DRIVER=smtp
MAIL_HOST=ssl0.ovh.net
MAIL_PORT=465
[email protected]
MAIL_PASSWORD=myEmailPassword
MAIL_ENCRYPTION=SSL

omarsow94 left a reply on HTTP To HTTPS • 4 months ago

@tomopongrac thanks for your reply, but it's doesn't redirect to public folder , i missed something ?

omarsow94 left a reply on Send Notification • 4 months ago

Need help please

omarsow94 left a reply on Send Notification • 4 months ago

Still need help

omarsow94 started a new conversation HTTP To HTTPS • 4 months ago

I try to redirect all URL to HTTPS://PUBLIC_FOLDER

i have the following code in my .htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/ [L]
</IfModule>

It's work fine in Firefox but not in Chrome

7th June, 2018

omarsow94 started a new conversation Send Notification • 4 months ago

I try to send notification when user register, i have no errors but don't receive emails (in production )

Notification class:

<?php

namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use App\User;

class VerifyEmail extends Notification
{
    use Queueable;

    public $user;

    /**
     * Create a new notification instance.
     *
     * @return void
     */
    public function __construct(User $user)
    {
        $this->user = $user;
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return ['mail'];
    }

    /**
     * Get the mail representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return \Illuminate\Notifications\Messages\MailMessage
     */
    public function toMail($notifiable)
    {
        return (new MailMessage)
                    ->line('Veillez vérifier votre email pour continuer.')
                    ->action('Verification email', route('verify', $this->user->token))
                    ->line('Merci à vous!');
    }

    /**
     * Get the array representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function toArray($notifiable)
    {
        return [
            //
        ];
    }
}

config/mail.php

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Mail Driver
    |--------------------------------------------------------------------------
    |
    | Laravel supports both SMTP and PHP's "mail" function as drivers for the
    | sending of e-mail. You may specify which one you're using throughout
    | your application here. By default, Laravel is setup for SMTP mail.
    |
    | Supported: "smtp", "sendmail", "mailgun", "mandrill", "ses",
    |            "sparkpost", "log", "array"
    |
    */

    'driver' => env('MAIL_DRIVER', 'smtp'),

    /*
    |--------------------------------------------------------------------------
    | SMTP Host Address
    |--------------------------------------------------------------------------
    |
    | Here you may provide the host address of the SMTP server used by your
    | applications. A default option is provided that is compatible with
    | the Mailgun mail service which will provide reliable deliveries.
    |
    */

    'host' => env('MAIL_HOST', 'smtp.mailgun.org'),

    /*
    |--------------------------------------------------------------------------
    | SMTP Host Port
    |--------------------------------------------------------------------------
    |
    | This is the SMTP port used by your application to deliver e-mails to
    | users of the application. Like the host we have set this value to
    | stay compatible with the Mailgun e-mail application by default.
    |
    */

    'port' => env('MAIL_PORT', 587),

    /*
    |--------------------------------------------------------------------------
    | Global "From" Address
    |--------------------------------------------------------------------------
    |
    | You may wish for all e-mails sent by your application to be sent from
    | the same address. Here, you may specify a name and address that is
    | used globally for all e-mails that are sent by your application.
    |
    */

    'from' => [
        'address' => env('MAIL_FROM_ADDRESS', '[email protected]'),
        'name' => env('MAIL_FROM_NAME', 'Example'),
    ],

    /*
    |--------------------------------------------------------------------------
    | E-Mail Encryption Protocol
    |--------------------------------------------------------------------------
    |
    | Here you may specify the encryption protocol that should be used when
    | the application send e-mail messages. A sensible default using the
    | transport layer security protocol should provide great security.
    |
    */

    'encryption' => env('MAIL_ENCRYPTION', 'tls'),

    /*
    |--------------------------------------------------------------------------
    | SMTP Server Username
    |--------------------------------------------------------------------------
    |
    | If your SMTP server requires a username for authentication, you should
    | set it here. This will get used to authenticate with your server on
    | connection. You may also set the "password" value below this one.
    |
    */

    'username' => env('MAIL_USERNAME'),

    'password' => env('MAIL_PASSWORD'),

    /*
    |--------------------------------------------------------------------------
    | Sendmail System Path
    |--------------------------------------------------------------------------
    |
    | When using the "sendmail" driver to send e-mails, we will need to know
    | the path to where Sendmail lives on this server. A default path has
    | been provided here, which will work well on most of your systems.
    |
    */

    'sendmail' => '/usr/sbin/sendmail -bs',

    /*
    |--------------------------------------------------------------------------
    | Markdown Mail Settings
    |--------------------------------------------------------------------------
    |
    | If you are using Markdown based email rendering, you may configure your
    | theme and component paths here, allowing you to customize the design
    | of the emails. Or, you may simply stick with the Laravel defaults!
    |
    */

    'markdown' => [
        'theme' => 'default',

        'paths' => [
            resource_path('views/vendor/mail'),
        ],
    ],

];

6th June, 2018

omarsow94 left a reply on Property Doesnot Exist On The Collection. • 4 months ago

try $user->pivot->role_id

4th June, 2018

omarsow94 started a new conversation Local Lang • 4 months ago

Hello, i try to change the local lang to fr , i use https://github.com/caouecs/Laravel-lang and clear cache , composer update BUT nothing changed .

3rd June, 2018

omarsow94 left a reply on Call To A Member Function DiffForHumans() On String • 4 months ago

Thank you all @Cronix ! @Snapey you too it's working fine

omarsow94 started a new conversation Call To A Member Function DiffForHumans() On String • 4 months ago

Hello, i have this error . I try to add one date column (type: timestamps() ) but when i try to do $date->diffForHumans() i have this error :Call to a member function diffForHumans() on string. It's not in carbon format but i didnew Carbbon::now()```

28th May, 2018

omarsow94 started a new conversation GitHub Markdown • 4 months ago

Hello, i want to implement github markdown like this Hi, i am a code! Yes Laravel or Symfony whatever you want

25th May, 2018

omarsow94 left a reply on Make:rule • 4 months ago

My bad, i missed the name ! sorry

omarsow94 started a new conversation Make:rule • 4 months ago

Hello, i try to run make custom my validator using this command php artisan make:rule but it's doesn't work ? Any change in the last laravel version ?

omarsow94 left a reply on Where Are You All From? • 4 months ago

Sénégal ( West Africa )

11th February, 2018

omarsow94 left a reply on ParseError: Syntax Error, Unexpected ')', Expecting '{' • 8 months ago

@Snapey thank you . i delete laravel.log et retry . It's work fine now, i had syntax error in my UserFactory class .

omarsow94 left a reply on ParseError: Syntax Error, Unexpected ')', Expecting '{' • 8 months ago

I know when i try vendor/phpunit/phpunit/phpunit command line .

omarsow94 left a reply on ParseError: Syntax Error, Unexpected ')', Expecting '{' • 8 months ago

Yes @Snapey and the last error is not about testGetComments function .

omarsow94 left a reply on ParseError: Syntax Error, Unexpected ')', Expecting '{' • 8 months ago

in

$post = factory(Post::class)->create(); from

public function testGetComments() {
        $post = factory(Post::class)->create();
        $comment = factory(Comment::class)->create(
          [ 'commentable_type' => 'Post', 'commentable_id' => $post->id ]
        );
        $comment2 = factory(Comment::class)->create(
          [ 'commentable_type' => 'Post', 'commentable_id' => $post->id ]
        );
        $comment3 = factory(Comment::class)->create(
          [ 'commentable_type' => 'Post', 'commentable_id' => $post->id ]
        );

        $response = $this->call('GET', '/comments', ['type' => 'Post', 'id' => $post->id]);
        $comments = json_decode($response->getContent());
        $this->assertEquals(200, $response->getStatusCode());
        $this->assertEquals(3, count($comments));
    }

omarsow94 left a reply on ParseError: Syntax Error, Unexpected ')', Expecting '{' • 8 months ago

in

$post = factory(Post::class)->create();

omarsow94 started a new conversation Teste • 8 months ago

teste

omarsow94 left a reply on Contact Us Form (sending Email) Laravel 5 • 8 months ago

teste

30th January, 2018

omarsow94 left a reply on Inner Join In Eloquent • 8 months ago

In your Manufacturer model , you have function like that

public function products{
    return belongsTo('App\Manufacturer');
}

?

omarsow94 started a new conversation URL Shortened - Waavi/url-shortener • 8 months ago

How to use Waavi/ur-shortener i have this error UrlShortened not found . I run all of command line https://github.com/Waavi/url-shortener but nothing.

27th January, 2018

omarsow94 left a reply on Error 401 • 8 months ago

@jcmargentina i add "s" but the error still. I try to check if all response are send in my console (Network / XHR) and i have Status Code:401 Unauthorized

omarsow94 left a reply on Error 401 • 8 months ago

omarsow94 started a new conversation Error 401 • 8 months ago

I have app.js:23492 GET http://127.0.0.1:8000/api/conversations 401 (Unauthorized) trying to get response (conversations in my case) . Someone can explain me please ?

My App\Http\Controllers\Api\ConversationsController.php file

<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Repositories\ConversationsRepository;
use Illuminate\Http\Request;

class ConversationsController extends Controller
{
    private $conversationRepository;

    public function __contruct(ConversationsRepository $conversationRepository){
        $this->conversationRepository = $conversationRepository;
    }
    public function index(Request $request){
        return response()
          ->json([
              'conversations' => $this->conversationRepository->getConversations($request->user()->id)
          ]);
    }
}

19th January, 2018

omarsow94 left a reply on Repositories • 9 months ago

I work fine now , i don't know exactly why, i just replace ConversationRepository by ConversationsRepository ( add s to Conversation) .

omarsow94 left a reply on Repositories • 9 months ago

It going ! I replace ConversationRepository by ConversationsRepository ( add s to Conversation) . Now i have this error : Trying to get property of non-object ( r ) on

  public function index()
    {
        return view('conversations.index',[
            'users' => $this->r->getConversations($this->auth->user()->id)
        ]);
    }

from my controller

<?php

namespace App\Http\Controllers;

use App\Repositories\ConversationsRepository;
use Illuminate\Http\Request;
use Illuminate\Auth\AuthManager;
use Illuminate\Support\Facades\Auth;
use App\User;


class ConversationsController extends Controller
{
    private $r;
    private $auth;

    public function __construct(ConversationsRepository $conversationRepository, AuthManager $auth)
    {
        $this->r = $conversationRepository;
        $this->auth = $auth;
    }
    public function index()
    {
        return view('conversations.index',[
            'users' => $this->r->getConversations($this->auth->user()->id)
        ]);
    }

    public function show(User $user)
    {
        return view('conversations.show',[
            'users' => $this->r->getConversations($this->auth->user()->id),
            'user' => $user
        ]);
    }

    public function store(User $user, Request $request)
    {
        $this->r-createMessage(
            $request->get('content'),
            $request->auth->user()->id,
            $user->id
        );
    }


}

omarsow94 left a reply on Repositories • 9 months ago

@deepu07 result :

>>> App\Repositories\ConversationRepository::getConversations(1);
PHP Deprecated:  Non-static method App\Repositories\ConversationRepository::getConversations() should not be called statically on line 1

18th January, 2018

omarsow94 left a reply on Repositories • 9 months ago

@MaverickChan i create a file locally , Ok @deepu07 i try stay touch

omarsow94 left a reply on Repositories • 9 months ago

No the repository . In Repositories folder

omarsow94 left a reply on Repositories • 9 months ago

Same error @deepu07 , i don't understand why Class App\Http\... doesn't exist , Http ? it's a Repository

omarsow94 left a reply on Repositories • 9 months ago

same error @deepu07 :

Class App\Repositories\cRepository does not exist

omarsow94 left a reply on Repositories • 9 months ago

I still have error, @jcmargentina when i replace my contruct param with ```(\App\Repositories\ConversationRepository $conversationRepository, AuthManager $auth) i have this error :

Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR), expecting identifier (T_STRING)

@jbloomstrom my App\Repositories\ConversationRepository file

<?php

namespace App\Repositories;

use Illuminate\Database\Eloquent\Model;
use App\User;
use App\Message;
use Carbon\Carbon;

class ConversationRepository
{

      private $user;
      private $message;

      public function __construct(User $user, Message $message)
      {
          $this->user = $user;
          $this->message = $message;
      }

      public function getConversations(int $userId) {
          $this->user->newQuery()
            ->select('name', 'id')
            ->where('id','!=', $userId)
            ->get();
      }

      public function createMessage(string $content, int $from, int $to){
          $this->message->newQuery()->create([
              'content' => $content;
              'from_id' => $from,
              'to_id' => $to,
              'created_at' => Carbon::now();
          ]);
      }

}

17th January, 2018

omarsow94 left a reply on Repositories • 9 months ago

I use Linux , i should put 777 ? (chmod) @MaverickChan

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.