MoeSaid

MoeSaid

Member Since 1 Year Ago

Experience Points 3,340
Experience Level 1

1,660 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 22
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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.

13 Aug
4 days ago

MoeSaid left a reply on Migration Does Not Register In Order

i know that, that's the confusing part, the tables are already ordered with the right order according to the timestamp but somehow after migration the order get missed up .

MoeSaid left a reply on Migration Does Not Register In Order

Nah, I export and import from my local database to try to test it on any other life databases, the thing is it exports & imports in the alphabetical order, which create issues when you import,

pretty much I get hit in the face with the SQL err

#1215 - Cannot add foreign key constraint 

MoeSaid started a new conversation Migration Does Not Register In Order

hi, guys, i have been working on this issue for two days now,

simply its a Foreign Key Issue with migration order,

when I run the migration, it runs as it supposed to, with the timestamp order as when it has been created, somehow tables never register in the database in the same order that they get migrated with,

some tables are relay on to reference Foreign Key to, works fine on localhost but when i export, tables get exported with the database order which starts to create an issue when I imported to any other database.

6WTnh.png 6WIoj.png

12 Aug
5 days ago

MoeSaid left a reply on Foreign Key Issue

handling references and checks for cascades on each case on its own will be hustling,

The second solution seems to be more fitting, but how tho ? how can i add all the foreign keys in just one migration file?

10 Aug
1 week ago

MoeSaid left a reply on Foreign Key Issue

foreign key set up on profiles references to the users

MoeSaid started a new conversation Foreign Key Issue

so I know that SQL databases aren't forgiving tell it comes to foreign keys, my issues are for somehow when I migrate the tables don't migrate in order,

for example i have users table created first and then profiles table comes after the users table , but when i migrate some how the profiles table migrate before the users table which creat issues with the foreign key .

I read about renaming the tables file as changing timestamp, so they get in order, but the files are already in order when it comes to timestamp.

whats the best practice to fix such an issue?

05 Aug
1 week ago

MoeSaid left a reply on Best Practice To Preventing Admin Account Making A Requests!!

this a pretty go way to go with,

how can I deduct the post and store methods in the middleware?

all that I can think of is detects the environment and redirect back, which we're putting a whiled middleware for the whole controller the get and the post methods.

MoeSaid started a new conversation Best Practice To Preventing Admin Account Making A Requests!!

Hi mates,

so am working on a couple of projects that require me to put demo version on the market to let the potential customer be able to check it out , however when they do normally they use the admin able to see what can they do with it , which may miss up the dummy content I put to show up the project .

the goal ware to prevent any (post, patch, put ) request from the admin panel, I have done that with javascript pretty much looking for any form on the page and reset the default action, it is not efficient since it can be disabled from the browser.

another way was in my mine is setting up helper function looking for specific data in Db, for example, a column value with DEMO or LIVE with return false or true and call this function on every request in admin controller which is more secure but a lot of work has to be done.

what's in your opinion would be a better way to go with?

22 Apr
3 months ago

MoeSaid left a reply on Storing Issue

ay guys all good , the issue was with my migration :D

MoeSaid started a new conversation Storing Issue

Hi mates, am facing a weird issue will store some data to the Db using axios

the issue is , when i push the data to the controller works without any issues once am trying to save it always return with err

Request failed with status code 500

here's my form

 <form >
        @csrf
        <textarea v-on:click="clear" v-on:keydown.enter="submit" class="form-control" v-model="msg" rows="8"></textarea>

        <button v-on:click="submit" class="btn btn-dark" type="button" name="button">
          <i class="fa fa-paper-plane"></i>
        </button>

      </form>

the vue component

var chat = new Vue({

          el: '#chat',

          data: {
              msg: 'Type New Message...',
              room: '{{$room->id}}',
              user: '{{auth()->user()->id}}',
              avatar: '{{auth()->user()->image}}',
          },

          methods: {

              clear: function (e) {
                    e.preventDefault();
                    this.msg = '';
              },

              submit : function (e) {
                  e.preventDefault();

                  axios.post('api/chat/add' , {
                      room:     this.room,
                      user:     this.user,
                      avatar:   this.avatar,
                      body:     this.msg

                  }).then(function (res) {

                      console.log(res.data);
                      // this.$emit('new' , res.data);

                  }).catch(function (err) {
                      console.log(err.message);
                  });

                  this.msg = '';
              }
          }

      });

my controller

public function new(Request $req)
    {
        $msg = new GroupChat;
        $msg->room_id = $req->room;
        $msg->user_id = $req->user;
        $msg->avatar  = $req->avatar;
        $msg->body    = $req->body;

        $msg->save();

        return response()->json($req);
    }

what am missing guys? appreciate any help.

30 Mar
4 months ago

MoeSaid started a new conversation Dynamic Custom Domain Routing

first time I looked at laravel before starting dig deep into it, I have been amazed of its built-in functionality, especially the subdomain routing, as “{subdomain}.app.com” and defending the subdomain with whatever you want with any logic you write.

right now I wonder how can replace “{subdomain}.app.com” to “userdomain.com” as using a custom domain of the user instead of the subdomain routing.

something like shopfy and wordpress etc . when the user can use a custom domain.

so mates what do you think about that? had anyone come across the same idea before?

13 Feb
6 months ago

MoeSaid left a reply on Illegal Offset Type

@CRONIX - oh ! thanks mate

MoeSaid started a new conversation Illegal Offset Type

Hi guys ,

i have been hfacing odd issue for the bast 2 days , need some hint

using validate() to check the data going thrugh the controller and some how return err

here's the controller

// update logo
    public function landing_logo(Request $req)
    {
      $req->validate([
        $req->logo   =>   'required',
      ]);
      
      $config = Config::find(1);
 
      $img = Storage::put('config' , $req->logo);
 
      $config->logo = $img;
      $config->save();
 
      return back()->with('serr', 'your logo has been update it .');
    }

when i comment the validate function it works just fine .

26 Jan
6 months ago

MoeSaid started a new conversation Any Alternative For Forge ?

Hi mates ,

is there any alternative for forge ! something that with simple options have a free plan ?

16 Jan
7 months ago

MoeSaid started a new conversation Video Call Api

Hi guys

am searching for video & voice calling api looking for something free to play with Webrtc seems the best solution so far but need time to get into it ,

any recommendation ?

14 Dec
8 months ago

MoeSaid left a reply on Cannot Add Foreign Key Constraint

@THOASTY - yeah this the issue now am using sequel pro i dont know if there is a way to make it take care of the order with it , am trying to figure this out

MoeSaid left a reply on Cannot Add Foreign Key Constraint

@BILLMN - well the date of the migration is okay the issue seems to be in the exporting as it seems like dont care about the order

13 Dec
8 months ago

MoeSaid left a reply on Cannot Add Foreign Key Constraint

@BILLMN - i figured that the follow table get imported before the users table which am using the user id from as foreign key , is there a way i can config the order of the imported table ! .

MoeSaid left a reply on Cannot Add Foreign Key Constraint

@BILLMN - same thing work just fine on my local environment but once i import it to server Db i get the err

MoeSaid started a new conversation Cannot Add Foreign Key Constraint

Hi guys , first time i face this error all work find on my local env but when i import the Db to my server i get it .

here's the schema of my table

public function up()
    {
        Schema::create(config('follow.followable_table', 'followables'), function (Blueprint $table) {
            $userForeignKey = config('follow.users_table_foreign_key', 'user_id');
            $table->unsignedInteger($userForeignKey);
            $table->unsignedInteger('followable_id');
            $table->string('followable_type')->index();
            $table->string('relation')->default('follow')->comment('follow/like/subscribe/favorite/upvote/downvote');
            $table->softDeletes();
            $table->timestamps();

            $table->foreign($userForeignKey)
                ->references(config('follow.users_table_primary_key', 'id'))
                ->on(config('follow.users_table_name', 'users'))
                ->onUpdate('cascade')
                ->onDelete('cascade');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::table(config('follow.followable_table', 'followables'), function ($table) {
            $table->dropForeign(config('follow.followable_table', 'followables').'_user_id_foreign');
        });

        Schema::drop(config('follow.followable_table', 'followables'));
    }

here is the error

http://take.ms/1jIIB

Error
SQL query:

CREATE TABLE  `followables` (

 `user_id` INT( 10 ) UNSIGNED NOT NULL ,
 `followable_id` INT( 10 ) UNSIGNED NOT NULL ,
 `followable_type` VARCHAR( 191 ) COLLATE utf8mb4_unicode_ci NOT NULL ,
 `relation` VARCHAR( 191 ) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT  'follow' COMMENT  'follow/like/subscribe/favorite/upvote/downvote',
 `deleted_at` TIMESTAMP NULL DEFAULT NULL ,
 `created_at` TIMESTAMP NULL DEFAULT NULL ,
 `updated_at` TIMESTAMP NULL DEFAULT NULL ,
KEY  `followables_user_id_foreign` (  `user_id` ) ,
KEY  `followables_followable_type_index` (  `followable_type` ) ,
CONSTRAINT  `followables_user_id_foreign` FOREIGN KEY (  `user_id` ) REFERENCES  `users` (  `id` ) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci;

MySQL said: Documentation

#1215 - Cannot add foreign key constraint 

any idea what went wrong ?

08 Dec
8 months ago

MoeSaid left a reply on Prevent Forms From Working

@PETRIT - i was going to work with the view and the controller but its hussle when the project is big , doing it with a middleware is the best thing to go with in my opinion but i still couldn't reach is logic , what would you recommend how the logic of its function looks like .

07 Dec
8 months ago

MoeSaid started a new conversation Prevent Forms From Working

Hi ,

am creating a project and i wanna put a demo for users to test , however they will have access to the admin aria , i want to prevent any form with post method of working , i did that with javascript by prevent the default methods , i was wondering if there a better way to do so , in case the javascript never loaded .

05 Dec
8 months ago

MoeSaid left a reply on Developing Packages

@RONI - oh thats a wrap ! thank mate

04 Dec
8 months ago

MoeSaid left a reply on Developing Packages

@JLRDW - oh yeah that's the standard that i'm using , am looking for like boilerplate any extra help , something to speed up the process a bit

MoeSaid started a new conversation Developing Packages

hi mates

i was looking into developing packages so if you have any references to that will be cool to share it .

cheers .

13 Nov
9 months ago

MoeSaid left a reply on Cannot Declare Class Because The Name Is Already In Use

oh snap !!! 22 hrs coding on row create hallucination :D

thanks mates .

MoeSaid left a reply on Cannot Declare Class Because The Name Is Already In Use

@SKOOBI - yeah when i googled the issue this what i understood , oddly all the controller are uniquely named

MoeSaid left a reply on Cannot Declare Class Because The Name Is Already In Use

@ANDREICH1980 - is the simple structure of controller however i update it the post with code and error , thanks for checking up tho

MoeSaid started a new conversation Cannot Declare Class Because The Name Is Already In Use

Hi guys ,

i just faced new issue never seen before , i have created a normal controller and somehow return error as the class can not be declare and its already in use !.

any one face this issue before ?


<?php
 
namespace App\Http\Controllers\User;
 
use App\Comment;
 
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
 
class Comment extends Controller
{
    // store
    public function store(Request $req , $id)
    {
      return $id;
    }
 
 
}
 
"Cannot declare class App\Http\Controllers\User\Comment because the name is already in use"
12 Mar
1 year ago

MoeSaid left a reply on There Is No Existing Directory At ".../storage/logs" And Its Not Buildable: Permission Denied

so the issue got fixed when i cleared the config cache

08 Mar
1 year ago

MoeSaid left a reply on #1071 - Specified Key Was Too Long; Max Key Length Is 767 Bytes

@bashy from yesterday and i was looking up for another host to get in , was going to get in with DigitalOcean but seams like they don't support international credit cards what would you advice me to use for Laravel ?

MoeSaid left a reply on #1071 - Specified Key Was Too Long; Max Key Length Is 767 Bytes

@bashy yes this what i did exactly my mysql version is 5.6.32 sad fact i cant update it since am on shared host

MoeSaid started a new conversation #1071 - Specified Key Was Too Long; Max Key Length Is 767 Bytes

hi guys !

so i have an issue tho with the database , i tried to use the Facades method

use Illuminate\Support\Facades\Schema; Schema::defaultStringLength(191);

and i do still get the same issue , what would you guys advice me to do ?

07 Mar
1 year ago

MoeSaid left a reply on There Is No Existing Directory At ".../storage/logs" And Its Not Buildable: Permission Denied

@davb i do use shared host , cant restart apache or some , but i have did deployed more than one laravel app on it and its works just fine i really don't know why i have such an err

MoeSaid left a reply on There Is No Existing Directory At ".../storage/logs" And Its Not Buildable: Permission Denied

huh i cleared the cache more than once , i uploaded with old school FTP really thankful helping me

MoeSaid left a reply on There Is No Existing Directory At ".../storage/logs" And Its Not Buildable: Permission Denied

the err am getting is

"/Users/mohamedsaed/Desktop/WORK/0Php/nutflix/storage/logs"

which is pointing out to my localhost , i thought that the log file are writeable and the server will over right it auto ,

and nope i haven't set this anywhere , but yeah i cleared the cash before uploading

MoeSaid started a new conversation There Is No Existing Directory At ".../storage/logs" And Its Not Buildable: Permission Denied

whats up guys ! , i do have some weird issue , project works fine on localhost but once i upload it on server its just gives me that err ,

i have been giving the storage folder 777 Permissions trying to fix the issue but none happen , what would you guys advice me to do !