nhayder

nhayder

Member Since 1 Year Ago

Doha

Experience Points 38,630
Experience Level 8

1,370 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 279
Lessons
Completed
Best Reply Awards 2
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.

17 Jun
20 hours ago

nhayder left a reply on 2 Mutators In 1 Model ??? Is Posible

@SNAPEY - Yah, that will totally solve the problem.

nhayder left a reply on 2 Mutators In 1 Model ??? Is Posible

@SNAPEY - how to use different name can you show some code ?

16 Jun
1 day ago

nhayder left a reply on 2 Mutators In 1 Model ??? Is Posible

Sorry about that, i will try to expand on what i'm trying to do,

i'm using a package that will allow me to embed media objects from almost 20 defendant social media sites (youtube, vimeo, instagram, ... etc), for this package to work i made a mutation that converts for example youtube page URL to an embedded iframe object using youtube page url only.

1- First inpoint : so to show youtube video on home i made this mutation

//my first widget.php model mutation is this
1-  the $value basically is  the video standard youtube page url 

    public function getEmbedAttribute($value)
    {
        $info = Embed::create($value); // this converts the URL to embedded video  (proper embedded iframe )

        return $info->code;

    }

the returned object is working fine and i'm being able to get the query with the converted object to display it on the public home page. (blade file)

//Like this
{!! $info->embed !!} // working beautifully 

2- inpoint - app cpanel :

form the app control panel side i have a different controller that hits that same model using another inpoint? obviously i'm getting the same embedded code because of the mutation that i already have on the model.

the difference here is that i don't need the object i just need an representation image of that youtube video. luckelly :-) The package i'm using can provide me with that image like this

// 2nd required mutation to fetch youtube video image

    public function getEmbedAttribute($value)
    {
        $info = Embed::create($value); 

        return $info->image; // this will return the image only (image not code)

    }

The current problem is this (2 in points hitting same model) :

every time i hit the widget.php model im getting the embedded code from public home page or from cpanel inpoint.

what i want to do is : when i hit the widget model from control panel i need to return the image, but when the user hits the front end home page laravel should get me the youtube object as iframe embedded object. unlike what i currently have (always getting the embedded object)

so how can i get 2 different output (image or video) using the same model, i need to let laravel know which mutatio to use according the inpoints that were executed to the run the query (home page or cpanel).

I hope it's clear for you now?

nhayder started a new conversation 2 Mutators In 1 Model ??? Is Posible

Hi, i'm in this situation where i'm accessing same model mutator from 2 different end points, so i need to make different mutator for every endpoint.

// this is the current mutator that i already have it fetches the code DB column

    public function getEmbedAttribute($value)
    {
        $info = Embed::create($value);

        return $info->code;

    }

the other mutator should fetches image instead of code,

    public function getEmbedAttribute($value)
    {
        $info = Embed::create($value);

        return $info->image;

    }

Any ideas ????

14 Jun
3 days ago

nhayder left a reply on Saving Javascript Data On DB (google Analytics + AdSense)

@CRONIX - Interesting, i Will definitely try your solution

nhayder started a new conversation Saving Javascript Data On DB (google Analytics + AdSense)

Hi,

i'm working on new app where my customer need to add Google analytics + adSense dynamically to the header of every page on the website.

I'm using https://github.com/mewebstudio/Purifier to sanitize inputs data, but it looks like the package is now allowing any even after i tried to add them to the package whitelist.

so my question is: How to safely store javascript code in database and render them to blade template.

10 Jun
1 week ago

nhayder started a new conversation Spatie/laravel-sitemap Not Crawling The Site (sitemap.xml Is Empty)

Hi, i'm using spatie/laravel-sitemap https://github.com/spatie/laravel-sitemap to auto-generate sitemap for my app.

as per the documentation i made a command to generate the the site map like this

<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Spatie\Sitemap\SitemapGenerator;

class GenerateSitemap extends Command
{
    /**
     * The console command name.
     *
     * @var string
     */
    protected $signature = 'sitemap:generate';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Generate the sitemap.';

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        // modify this to your own needs
        SitemapGenerator::create(config('app.url'))

            ->writeToFile(public_path('sitemap.xml'));
            
    }
}

The site map is file is created but its empty so basically it looks like the package is not crawling the app as it should do,

has anybody used this package, How to fix this issue ???

08 Jun
1 week ago

nhayder left a reply on Custom Helper Files Ar Not Working On Shared Hosting Account

@SNAPEY - I made the App like this app, then run composer dump-autoload and it worked

"files" :[
            "app/Helpers/activeAdminSidebar.php", 
            "app/Helpers/messages.php",
            "app/Helpers/isOnline.php"
        ]

@snapey You are awesome :-) thank you man

nhayder left a reply on Custom Helper Files Ar Not Working On Shared Hosting Account

@SNAPEY - Thank you for your note, i checked the files and it looks like they are matching,

// files in Helpers folder are (Helpers/)
1- activeAdminSidebar.php
2- isOnline.php
3- messages.php

on composer.jason i have them declared like this

    "autoload": {
        "classmap": [
            "database/seeds",
            "database/factories"
        ],
        "psr-4": {
            "App\": "app/"
        },
        "files" :[
            "App/Helpers/activeAdminSidebar.php", 
            "App/Helpers/messages.php",
            "App/Helpers/isOnline.php"
        ]
    },

How i setup the APP on shared hosting is this

outside public_html i have create a folder called demo where i'm storing all laravel files in, as for public folder

i'm using default public_html folder to place laravel public files instead the default public folder that comes with laravel.

also i have updated the index.php files in public_html like this

require __DIR__.'/../demo/vendor/autoload.php';

and 

$app = require_once __DIR__.'/../demo/bootstrap/app.php';

the app is working perfectly on localhost, and on shared account, but every time the app needed any helper functions it breaks,

error sample


Call to undefined function setMainButton() (View: /home/demolinx/demo/resources/views/layouts/sidemenu.blade.php) (View: /home/demolinx/demo/resources/views/layouts/sidemenu.blade.php) (View: /home/demolinx/demo/resources/views/layouts/sidemenu.blade.php)

the setMainButton() function is available on one of the helpers files (activeAdminSidebar.php)

// this is my activeAdminSidebar.php file
<?php

function setMainButton($path){

    return Request::segment(3) === $path ? 'active' : '';

}

function setArrow($path){

    return Request::segment(3) === $path ? 'collapse show' : 'collapse';

}

function activeGroup($path){
    // groupe set
    return Request::segment(3) === $path ? '' : 'collapsed';

}

function setCollapsed($path){
    // collpsed icon function
    return Request::segment(4) === $path ? '' : 'collapsed';

}

function setActive($path){

    return Request::segment(4) === $path ? 'active' : '';

}


Do you see anything in my setup that might cause this type of errors.

nhayder started a new conversation Custom Helper Files And Not Working On Shared Hosting Account

i have 3 files added to composer.jason file

        "files" :[
            "App/Helpers/activeAdminSidebar.php", 
            "App/Helpers/messages.php",
            "App/Helpers/isOnline.php"
        ]

The app is fully active on a share hosting account (working perfectly ) except when these 3 files are called withen the app. at that poing im getting this error

Call to undefined function setMainButton() (View: /home/demolinx/resources/views/layouts/sidemenu.blade.php) (View: /home/demolinx/resources/views/layouts/sidemenu.blade.php) (View: /home/demolinx/resources/views/layouts/sidemenu.blade.php)

the setMainButton() is defined in one of the helpers files, Clearly the helper file are not loaded correctly this is why i'm getting these errors.

so my question is? how to reload the helper file on shared hosting using ssh ????

NOTE : composer dump-autoload + composer install is not fixing it for me

24 May
3 weeks ago

nhayder started a new conversation How To Add New Element To Array

i have this array fetched from db

$contact = Form::find($id);

// returning

{
    "name":"myapp",
    "email":"[email protected]",
    "phone":"+973424242",
    "message":"<p>p<\/p>",
    "updated_at":"2019-05-24 14:58:46",
    "created_at":"2019-05-24 14:58:46","id":20
}

how to add another element to above array ????

nhayder left a reply on How To Check Queue Errors

clear, But they are still not moved failed_jobs table yet, I can see them on the jobs table with attempts of 255.

so how to check the error at this point, Before the are moved to failed_jobs table and after exceeding all attempts

nhayder started a new conversation How To Check Whre

i have a contact form that queue's the emails using event & listener, the jobs keeps on failing to execute and i can see any thing to help me identify the error?

How to debug queued jobs when they fail?? there should be something that through error so i can fix it

how to get the error message for failed jobs

20 May
4 weeks ago

nhayder started a new conversation Contact Us From Error "Trying To Get Property Of Non-object" For Event Listner

i have a contact us from that triggers an event to send the email, i'm getting this error when i attempt to submit the email from the event listener


"Trying to get property of non-object"

this is my event listner

class DiliverContactFormEmailListner
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  NewContactFormEmailStoredEvent  $event
     * @return void
     */
    public function handle(NewContactFormEmailStoredEvent $event)
    {   
        Mail::to($event->contact->email)->send(new SendContactFormEmailToDestination());
    }
}

the $contact array is passed by the main event like this

class NewContactFormEmailStoredEvent 
{
    use Dispatchable, InteractsWithSockets, SerializesModels;

    public $contact;

    public function __construct($contact)
    {
        $this->$contact = $contact;
    }

}

this is what i have on the contact object

{
    "name":"News","email":"[email protected]","phone":"+97431313270","message":"this is the message","status":"new","updated_at":"2019-05-20 15:06:06","created_at":"2019-05-20 15:06:06","id":27}

any ideas ???

19 May
4 weeks ago

nhayder left a reply on Deploying Laravel App On Cpanel Shared Account

yes it it, the site is working just fine but i can run any artisan command from terminal due to that error

18 May
4 weeks ago

nhayder left a reply on Deploying Laravel App On Cpanel Shared Account

@CRONIX - Yes you can access the website normarly by pointing the browser to subdomain, and website opens normally, The only problem i facing is when i ssh any php artisan command from terminal on my mac, i'm getting this error

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
Could not open input file: artisan

it looks like perl has something to do with it, But i'm not sure what it is

nhayder left a reply on Deploying Laravel App On Cpanel Shared Account

@JLRDW - I’m getting

This site can’t be reached

deno.myapp.com’s server IP address could not be found. Try: Checking the connection

nhayder left a reply on Deploying Laravel App On Cpanel Shared Account

the site is already up and running on shared hosting account, so there is no need to re explain how it works.

thought i feel that i did't explain the issue correctly so i gone ahead and updated my initial post.

the error appears when using ssh to execute any artisan command?

nhayder started a new conversation Deploying Laravel App On Cpanel Shared Account

i was struggling to deploy my first laravel app on shared hosting account running cpanel? the app is running as expected but i'm having some errors when i attempt to run any php artisan command, have a look at the error below

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
Could not open input file: artisan

Any ideas on how to fix this issue ???

17 May
1 month ago

nhayder started a new conversation I'm Getting Error When I Attempt To Bind Data Passed From Getter Filter Function

i'm filtering vuex store pages object bussing getter like this

    getters: {
       getPageSettings: (state) => (id) => {

            return state.pages.find(pages => pages.id === id)

        }
    }

and from my component i'm able to display that data properly,

  computed:{

        page () {

            return this.$store.getters.getPageSettings(this.id)

        }

    },

i'm binding data on my component like this

<input v-model="page.name" type="text" name="name">

<input v-model="page.slug"  type="text" name="slug">

i'm able to see correct data on abve form so there is nothing wrong with it apart from error i'm seeing on chrome dev tools

[Vue warn]: Error in render: "TypeError: Cannot read property 'name' of undefined"

``
Well, The name is defined and save on the store/state/pages object

[

  • {

    • id: 3,

    • created_at: "2019-05-16 06:26:44",

    • updated_at: "2019-05-16 06:26:44",

    • name: "services",

    • homepage: 0,

    • direction: "0",

    • language_id: "en",

    • position: 0,

    • keywords: "Keyword1, keyword2, keyword3",

    • description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas enim tellus, efficitur a urna id, dictum ornare quam. Nunc volutpat justo ut tortor fermentum finibus. Donec vulputate faucibus convallis",

    • smcard: "placeholder.png",

    • slug: "services",},

  • {

    • id: 2,

    • created_at: "2019-05-16 06:26:44",

    • updated_at: "2019-05-16 06:26:44",

    • name: "about us",

    • homepage: 0,

    • direction: "0",

    • language_id: "en",

    • position: 0,

    • keywords: "Keyword1, keyword2, keyword3",

    • description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas enim tellus, efficitur a urna id, dictum ornare quam. Nunc volutpat justo ut tortor fermentum finibus. Donec vulputate faucibus convallis",

    • smcard: "placeholder.png",

    • slug: "about-us",},

  • {

    • id: 1,

    • created_at: "2019-05-16 06:26:44",

    • updated_at: "2019-05-16 06:26:44",

    • name: "home",

    • homepage: 1,

    • direction: "1",

    • language_id: "en",

    • position: 0,

    • keywords: "Keyword1, keyword2, keyword3",

    • description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas enim tellus, efficitur a urna id, dictum ornare quam. Nunc volutpat justo ut tortor fermentum finibus. Donec vulputate faucibus convallis",

    • smcard: "placeholder.png",

    • slug: "home",},

]


so basically the data is being binded and i can see them on the form but chrome dev tools is still giving me error ???

Any idea what is going on
16 May
1 month ago

nhayder started a new conversation I'm Getting Errors When I Bind Vuex Getter Data

i'm filtering vuex store pages object bussing getter like this

    getters: {
       getPageSettings: (state) => (id) => {
            return state.pages.find(pages => pages.id === id)
        }
    }

and from my component i'm able to display that data properly,

  computed:{
    ...mapState(['getPageSettings']),
        page () {
            return this.$store.getters.getPageSettings(this.id)
        }
    },

i'm binding data on my component like this

<input v-model="page.name" type="text" name="name">

<input v-model="page.slug"  type="text" name="slug">

i'm able to see correct data on abve form so there is nothing wrong with it apart from error i'm seeing on chrome dev tools

[Vue warn]: Error in render: "TypeError: Cannot read property 'name' of undefined"

``
Well, The name is defined and save on the store/state/pages object

[

  • {

    • id: 3,

    • created_at: "2019-05-16 06:26:44",

    • updated_at: "2019-05-16 06:26:44",

    • name: "services",

    • homepage: 0,

    • direction: "0",

    • language_id: "en",

    • position: 0,

    • keywords: "Keyword1, keyword2, keyword3",

    • description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas enim tellus, efficitur a urna id, dictum ornare quam. Nunc volutpat justo ut tortor fermentum finibus. Donec vulputate faucibus convallis",

    • smcard: "placeholder.png",

    • slug: "services",},

  • {

    • id: 2,

    • created_at: "2019-05-16 06:26:44",

    • updated_at: "2019-05-16 06:26:44",

    • name: "about us",

    • homepage: 0,

    • direction: "0",

    • language_id: "en",

    • position: 0,

    • keywords: "Keyword1, keyword2, keyword3",

    • description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas enim tellus, efficitur a urna id, dictum ornare quam. Nunc volutpat justo ut tortor fermentum finibus. Donec vulputate faucibus convallis",

    • smcard: "placeholder.png",

    • slug: "about-us",},

  • {

    • id: 1,

    • created_at: "2019-05-16 06:26:44",

    • updated_at: "2019-05-16 06:26:44",

    • name: "home",

    • homepage: 1,

    • direction: "1",

    • language_id: "en",

    • position: 0,

    • keywords: "Keyword1, keyword2, keyword3",

    • description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas enim tellus, efficitur a urna id, dictum ornare quam. Nunc volutpat justo ut tortor fermentum finibus. Donec vulputate faucibus convallis",

    • smcard: "placeholder.png",

    • slug: "home",},

]


so basically the data is being binded and i can see them on the form but chrome dev tools is still giving me error ???

Any idea what is going on 

all the best

nhayder started a new conversation Passing Id To Getter Function

hi, i'm using vuex with laravel as backend for my app, ..

in vuex i have pages array containing all the pages on the website

import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex, axios);

export const store = new Vuex.Store({

    state:{
        pages   : [], // this is the array
    
    },

    getters: {
       
       // this is the function that will filter the page by id, so how to pass the id to this funciton
       getPageSettings: (state) => (id) => {
            
            return state.pages.find(pages => pages.id === id)
            
        }
        
    }

the part im struggling with is that i need to allow the user to change page settings by passing page id to getter function above, In this way i can filter requested page among other pages and display it on proper form for the user to update.

So i have gone ahead and mapped the getter function in my update page component like this

  computed:{

    ...mapGetters(['getPageSettings']),

    },

i can get the getPageSettings on vueDevTools if i fixed the getter function like this.

    getters: {

       getPageSettings: (state) => (id) => {
            
            return state.pages.find(pages => pages.id === 5)
            
        }
        
    }

so my question is how can i pass the ID form the component to store getter function.

Any ideas, ...

14 May
1 month ago

nhayder left a reply on Errors White Deploying Laravel Application On CPanle Shared Hosting Account

@JLRDW - 7.2 with laravel 5.8 upgrade from 5.6 then 5.7 to 5.8

12 May
1 month ago

nhayder left a reply on Errors White Deploying Laravel Application On CPanle Shared Hosting Account

@bobbybouwmann Yes i didn try to run composer dump-autoload but i keep getting


Parse error: syntax error, unexpected '?' in /home/demolinx/linxtter/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 500
[[email protected] linxtter]$ 

not sure why

nhayder started a new conversation Errors White Deploying Laravel Application On CPanle Shared Hosting Account

Hi,

i'm trying to deploy a laravel 5.8 app on shared hosting account running cpanel, i'm getting a composer error not sure how to fix it

// error found in account log file
[09-May-2019 12:25:07 UTC] PHP Warning:  require(/home/demo/vendor/composer/../../App/Helpers/activeAdminSidebar.php): failed to open stream: No such file or directory in /home/demo/vendor/composer/autoload_real.php on line 66

i made the helper file in /App/Helpers/activeAdminSidebar.php and its the files that is giving me the error,

any ideas on how to fix this error ???

11 May
1 month ago

nhayder left a reply on Deploying Laravel On Cpanel Shared Account Failed - Composer Error

packages are already uploaded to the account ?im not sure why i need to install them again ???

can you explain please

nhayder started a new conversation Deploying Laravel On Cpanel Shared Account Failed - Composer Error

Hi,

i'm trying to deploy a laravel 5.8 app on shared hosting account running cpanel, i'm getting a composer error not sure how to fix it


[09-May-2019 12:25:07 UTC] PHP Warning:  require(/home/demolinx/vendor/composer/../../App/Helpers/activeAdminSidebar.php): failed to open stream: No such file or directory in /home/demolinx/linxtter/vendor/composer/autoload_real.php on line 66

i made the helper file in /App/Helpers/activeAdminSidebar.php and its the files that is giving me the error,

any ideas on how to fix this error ???

09 May
1 month ago

nhayder left a reply on Deploying Laravel App On Cpanel Is Returning Symfony/polyfill-mbstring/bootstrap.php

@MUNAZZIL - i'm using php 7.2 and the reset of extensions are included ( as per my initial post )

OpenSSL PHP Extension -> installed
PDO PHP Extension -> installed
Mbstring PHP Extension -> installed
Tokenizer PHP Extension -> installed
XML PHP Extension -> installed
Ctype PHP Extension -> installed
JSON PHP Extension -> installed
BCMath PHP Extension -> installed

as per the reset of your comment im not sure what you mean with

 Options +FollowSymLinks -Indexes
 RewriteEngine On

RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

can you explain what you mean

08 May
1 month ago

nhayder left a reply on Deploying Laravel App On Cpanel Is Returning Symfony/polyfill-mbstring/bootstrap.php

@MUNAZZIL - the .htaccess file has not changed since i installed laravel on this project, have a look

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

nhayder started a new conversation Deploying Laravel App On Cpanel Is Returning Symfony/polyfill-mbstring/bootstrap.php

i'm trying to deploy laravel 5.8 app on a cpanel shared account, so far im not being able to get the home page to load on the browser?

This page isn’t working demo.app.com is currently unable to handle this request.
HTTP ERROR 500

on the account log file i have these


[08-May-2019 06:00:40 UTC] PHP Warning:  require(/home/demolinx/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php): failed to open stream: No such file or directory in /home/demolinx/vendor/composer/autoload_real.php on line 66
[08-May-2019 06:00:40 UTC] PHP Warning:  require(/home/demolinx/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php): failed to open stream: No such file or directory in /home/demolinx/vendor/composer/autoload_real.php on line 66
[08-May-2019 06:00:40 UTC] PHP Fatal error:  require(): Failed opening required '/home/demolinx/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php' (include_path='.:/opt/cpanel/ea-php71/root/usr/share/pear') in /home/demolinx/vendor/composer/autoload_real.php on line 66
[08-May-2019 06:15:24 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'php_mbstring.dll' (tried: /opt/cpanel/ea-php72/root/usr/lib64/php/modules/php_mbstring.dll (/opt/cpanel/ea-php72/root/usr/lib64/php/modules/php_mbstring.dll: cannot open shared object file: No such file or directory), /opt/cpanel/ea-php72/root/usr/lib64/php/modules/php_mbstring.dll.so (/opt/cpanel/ea-php72/root/usr/lib64/php/modules/php_mbstring.dll.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[08-May-2019 06:15:24 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'php_mbstring.dll' (tried: /opt/cpanel/ea-php72/root/usr/lib64/php/modules/php_mbstring.dll (/opt/cpanel/ea-php72/root/usr/lib64/php/modules/php_mbstring.dll: cannot open shared object file: No such file or directory), /opt/cpanel/ea-php72/root/usr/lib64/php/modules/php_mbstring.dll.so (/opt/cpanel/ea-php72/root/usr/lib64/php/modules/php_mbstring.dll.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[08-May-2019 06:15:33 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'php_mbstring.dll' (tried: /opt/cpanel/ea-php72/root/usr/lib64/php/modules/php_mbstring.dll (/opt/cpanel/ea-php72/root/usr/lib64/php/modules/php_mbstring.dll: cannot open shared object file: No such file or directory), /opt/cpanel/ea-php72/root/usr/lib64/php/modules/php_mbstring.dll.so (/opt/cpanel/ea-php72/root/usr/lib64/php/modules/php_mbstring.dll.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[08-May-2019 06:15:33 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'php_mbstring.dll' (tried: /opt/cpanel/ea-php72/root/usr/lib64/php/modules/php_mbstring.dll (/opt/cpanel/ea-php72/root/usr/lib64/php/modules/php_mbstring.dll: cannot open shared object file: No such file or directory), /opt/cpanel/ea-php72/root/usr/lib64/php/modules/php_mbstring.dll.so (/opt/cpanel/ea-php72/root/usr/lib64/php/modules/php_mbstring.dll.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

according to my research that error is because of missing extension on the account,

i made sure that all required php extensions are available on the account

// these are all available on the account
PHP >= 7.1.3
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension
XML PHP Extension
Ctype PHP Extension
JSON PHP Extension
BCMath PHP Extension

any ideas on how to fix this issue ???

22 Apr
1 month ago

nhayder left a reply on How To Allow Blade To Except (<a Href>, <br /> ... Etc)

@ashraam you solution is not secured? by doing this {!! $code !!} the page will render every html the a user might add to the input field? where i need to filter them ??? ( + keyboard enter + ).

My question was ??? is there is a laravel way of filtering html tags from blade engin???

i can use aanitization package if i have to, i'm just trying to find how laravel will handle it nativally with not extra package?

@jlrdw What is your recommendations for my case

nhayder started a new conversation How To Allow Blade To Except (<a Href>, <br /> ... Etc)

I have contenteditable div on my app, using vue im saving input of the user like this

// example
            <h1 v-html="widget.title" ref="wTitle"

            @blur="save"

                contentEditable>
              
            </h1>

// this is vue save function
            save: function(){

                let id = this.id;

                let text = this.$refs.wTitle.innerHTML;

                this.$store.dispatch('saveText', [id, text, 'title']);

            },


the code above is not allowing me to save keyboard (enter, white space) in stead its returning html on the page

// something like this
[space bar click] [space bar click] this is my name [space bar click] [keyboard enter]
&nbsp; &nbsp;this is my name&nbsp; &nbsp;

and its stripping out tags, ...

i want blade to except specific html tags like , [space bar click]etc, ...

i'm NOT planning to use sanitization packages because most of the are not updated,

preferably i want to use laravel build it features to help out in rendering specific tags on the page.

Any Ideas ????

30 Mar
2 months ago

nhayder left a reply on Looking For Package Recommendation To Parse Youtube Video

@cronix just corrected the original post? Thanks anyway

nhayder left a reply on Looking For Package Recommendation To Parse Youtube Video

@cronix i was thinking of a package so i will be able to embed not only youtube video with others providers like vimeo, dailymotion, videospace, ... etc

nhayder left a reply on Looking For Package Recommendation To Parse Youtube Video

@CRONIX - @cronix how are you, what i mean is to let me user to use proper url like

https://www.youtube.com/watch?v=8cqtnUNsl_g

and the package should embed it properly

<iframe width="560" height="315" src="#####" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

nhayder started a new conversation Looking For Package Recommendation To Parse Youtube Video

Looking for reliable package for laravel 5.8 to parse youtube video intro embedded media, ???

Any recommendations

29 Mar
2 months ago

nhayder left a reply on Dynamically Run Seeder File From Controller

this solved the issue

        $class = "\Database\Seeds\$request->seederFile";

i removed the {} and the () from same line

nhayder left a reply on Dynamically Run Seeder File From Controller

@MANELGAVALDA - @manelgavalda I updated the code as per your remarks but still getting different error

{message: "Method Illuminate\Http\Request::installer does not exist.",…}

through the dd($request->seederFile) is returning the correct data

nhayder started a new conversation Dynamically Run Seeder File From Controller

I'm seeding DB records from controller and things are going well till i'm decided to dynamically seed DB from multiple files

        $wSeeder = new \Database\Seeds\_JumbotronSeeder();

        $wSeeder->run($request->page_id, $wSorting);

so i need to do something like this

        $wSeeder = new \Database\Seeds$request->seederFile();

        $wSeeder->run($request->page_id, $wSorting);

``

the solution above will totally help me out with my issued but i keep on getting error

{message: "syntax error, unexpected '$request' (T_VARIABLE), expecting identifier (T_STRING)",…}


any ideas on how to fix this ???
28 Mar
2 months ago

nhayder left a reply on Scroll Page To Page To Section With Maching ID

@ftiersch thank you for your comment, the ID is correct on the code, but NOW im trying to make the same functionality with vue refs.

so what would the code look like using ref's

nhayder started a new conversation Scroll Page To Page Section With Highest ID

i have a blade page with multiple sections, using JS i need to scroll page to the section with highest ID

// this is the section
              <section class="flex flex-col justify-center relative widget-bg-image" 

                v-for="(widget, index) in widgets" :key="widget.id" 

                :class="[ wCornerTL(widget), wCornerTR(widget) ]"

                :id="widget.id"

              >

when the page loads it should scroll to the section with highest id

  created(){

    Event.$on('requestToScrollPageDown', (id) => {
        
          var ele = document.getElementById('widget-'+id);

          var maxid = 0;

          ele.map(function(obj){   

              if (obj.id > maxid) maxid = obj.id;

              var maxID = 'widget-'+maxid;

          });

          window.scrollTo(maxID.offsetLeft,maxID.offsetTop); 

    });

any idea on how to fix this ????

24 Mar
2 months ago

nhayder started a new conversation Can't Force Laravel To Href Link Should Be From Root

This should be simple but yet its not getting done, :-0,

i have freaking simple href link and laravel keeps appending the link to http://127.0.0.1:8000 to the beginning of the link.

on my controller the $button->weblink contains http://abc.com but instead to visiting http://abc.com laravel is giving me http://127.0.0.1:8000/http://abc.com.

i tried these but nothing seems to fix the issues ???


<a href="{{url($button->weblink)}}"></a> // returning http://127.0.0.1:8000/http://abc.com

<a href="{{$button->weblink}}"></a> // returning http://127.0.0.1:8000/http://abc.com

<a href="/{{$button->weblink}}"></a> // returning http://127.0.0.1:8000/http://abc.com

how to fix this thing ??? the link should redirects to http://abc.com

any idea ???

nhayder left a reply on Can't Access Seeder File After Moving File Storage

@manelgavalda are you sure about the reserved keywords thing ??? because i changed the name to

Database\Seeds\Aaa\Anyname\TestSeeder.php

and i'm still getting same error

{message: "Class 'Database\Seeds\aaa\Najem\TestSeeder' not found",…}

I'm not sure if i understood you correctly

nhayder left a reply on Can't Access Seeder File After Moving File Storage

@manelgavalda Can you have a look at this update

nhayder started a new conversation Can't Access Seeder File After Moving File Storage

i'm a seeder file \Database\Seeds\TestSeeder.php and i'm running the file from controller like this

<?php

namespace App\Http\Controllers;

use Illuminate\Database\Seeder;
use Illuminate\Http\Request;
use App\Widget;
use cache;

use Illuminate\Support\Facades\DB;

class WidgetController extends Controller
{

    public function store(Request $request)
    {
        $seeder = new \Database\Seeds\Widgets\Static\TestSeeder();

        $seeder->run();
        
    }

I started getting this error after moving the file to \Database\Seeds\Widgets\Static\TestSeeder.php

{message: "syntax error, unexpected 'Static' (T_STATIC), expecting identifier (T_STRING)",…}

this is my seeder file

<?php
namespace Database\Seeds;

use Illuminate\Database\Seeder;

class TestSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        \DB::table('widgets')->insert([
            [
                'name' => 'intro-jumbotron',
                'user_name' => '',

                'dynamicbtn' => '0',
                'dynamicbtnurl' => 'javascript:void(0)',
                'cellmanagement' => '0',
                'fullscreendisabled' => '1',
                'showbuttonsdisabled' => '1',
                'showarrowdisabled' => '1',

                'page_id' => '1',
                'sorting' => '1',
           
                'fullscreen' => '0',
                'narrow' => '1',
                'pt' => 'pt-10',
                'pb' => 'pb-10',
                'mt' => '0',
                'mb' => '0',
                'mr' => '0',
        // ->list continues

any ideas

nhayder left a reply on Can't Access Seeder File From Controller

@manelgavalda yah, it's working now, Thank you

nhayder left a reply on Can't Access Seeder File From Controller

@manelgavalda after dump-autoload im getting

{message: "Class 'Database\Seeds\DB' not found",…}

nhayder left a reply on Can't Access Seeder File From Controller

@MANELGAVALDA - thank you but still cant access the file

updated seeder

<?php
namespace Database\Seeds

use Illuminate\Database\Seeder;

class TestSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        DB::table('widgets')->insert([
            [
                'name' => 'intro-jumbotron',
                'user_name' => '',

                'dynamicbtn' => '0',
                'dynamicbtnurl' => 'javascript:void(0)',
                'cellmanagement' => '0',
                'fullscreendisabled' => '1',
                'showbuttonsdisabled' => '1',
                'showarrowdisabled' => '1',

                'page_id' => '1',
                'sorting' => '1',
           
                'fullscreen' => '0',
                'narrow' => '1',
                'pt' => 'pt-10',
                'pb' => 'pb-10',
                'mt' => '0',
                'mb' => '0',
                'mr' => '0',
                'ml' => '0',