boynet

boynet

Member Since 3 Years Ago

Experience Points 12,205
Experience Level 3

2,795 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 124
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 Dec
1 year ago

boynet left a reply on 301 Redirect To Non Index.php Url

anyone looking for php side solution, create a global middleware with this code: make sure your config.app.url is configured

<?php
namespace App\Http\Middleware;
use Closure;

class RedirectIndexPhp
{
    /**
     * Handle an incoming request.
     *
     * @param \Illuminate\Http\Request $request
     * @param \Closure $next
     *
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        //redirect url like example.com/index.php/test to example.com/test
        $find = "index.php";
        $pos = strpos($request->fullUrl(), $find);
        if ($pos !== false) {
            $url = substr($request->fullUrl(), strpos($request->fullUrl(), $find) + strlen($find));
            return redirect(config('app.url') . $url, 301);
        }
        return $next($request);
    }
}
25 Jul
1 year ago

boynet left a reply on Getting "The Bootstrap/cache Directory Must Be Present And Writable" After Each Deployment

cache clear is clearing all my cache right? is obviously not the solution, i am talking about production environment where its a bad idea of clearing the cache

about

And make sure folder permission is set correctly. Report Spam Icon

yap that's the solution but I am asking why envoyer doesn't do it for me as its should be, so I think there is some deeper bug\problem here

24 Jul
1 year ago

boynet started a new conversation Getting "The Bootstrap/cache Directory Must Be Present And Writable" After Each Deployment

each time after a deployment I am getting this error:

The bootstrap/cache directory must be present and writable.

I can easily solving it by giving a write permission to this folder after each deployment

but of course it doesn't support to be this way as its need to be zero downtime deployment so whats Ive done wrong? why envoyer doesn't auto give write permission for this directory after each deployment on its own?

12 Jul
1 year ago

boynet started a new conversation In Laravel\mvc Where Is The Appropriate Place For Seo Stuff?

for example the page title, description etc?

in controller? something like:

public function index(){
    $title= "page title";
    return View::make('page',compact('title'));
}

in the blade himself? like:

@section('seo')
 @slot('title') page title @endslot
@endsection

maybe in dedicated class? like

class Seo {
public function index(){
    return [
        'title'=>'page title';
    ]
 }
}
02 Jul
1 year ago

boynet started a new conversation Eloquent How To Binding Variable Into Inet_aton

so I want to save user ip address into eloquent model, how to use variable binding with inet_aton?

$ip = Request::getClientIp();
...
$post->user_ip = DB::raw("inet_aton('$ip')");
$post->save()

I don't like using the $ip variable directly into DB::raw as its bad practice I am looking for someway of escaping\binding it like:

DB::insert('insert into users (ip) values (?)', [$ip]);
19 Mar
1 year ago

boynet left a reply on Docs Not Clear About Phpredis Usage?

so I find the answer

what happen is when you install phpredis extension its register itself into the "Redis" name so now your Redis alias will collapse with the phpredis extenstion so you need to rename your extension to whatever you what like:

'Phpredis' => Illuminate\Support\Facades\Redis::class,

now instead of using Redis:: facade you need to call Phpredis:: facde

for this time of written the laravel integration is still in "beta" stage so things like pipeline not work like in the docs (pr was made to fix this https://github.com/laravel/framework/pull/18421) but I am not 100% that everything else will work flawlessly

boynet started a new conversation Docs Not Clear About Phpredis Usage?

in the phpredis section https://laravel.com/docs/5.4/redis#phpredis they have this unclear warning:

If you have the PhpRedis PHP extension installed via PECL, you will need to rename the Redis > alias in your config/app.php configuration file.

anyone know what does it really mean? like changing to alias to what?

boynet left a reply on Why Some Variable Are Not .enviable By Default?

@ctroms thanks I guess that it make some sense

I was looking for a way to never touch the laravel files for easier framework upgrade so now when a new version come out I will need to recheck for changes the all configs files

boynet started a new conversation Why Some Variable Are Not .enviable By Default?

for example in config/app.php the time zone used like 'timezone' => 'UTC'

so If I want to change this value inside .enc I need to edit the config files directly, why not all options are there by default? it make me think that maybe I should not change those?

boynet started a new conversation Best Practice For Easy Upgradeable Project Structure?

is it possible to create project that almost use none of the default files\directory?

like creating a new folder project and put all my code there and when a new version popup just replace the whole files, anyone successfully achieve this?

23 Feb
1 year ago

boynet started a new conversation Forge How To Disable Nginx Default Redirection?

inside nginx/forge-conf/be106.net/before/redirect.conf file there is this simple config:

server {
    listen 80;
    listen [::]:80;

    server_name www.my-domain.net;
    return 301 $scheme://my-domain.net$request_uri;
}

is there a simple way of removing this without altering the file itself(as it look like bad idea). or removing the forge include line(as it bad idea also)

I want the site to be accessible from different domains also

boynet left a reply on Forge How To Change The Default Nginx Configuration?

Thanks totally missed that not excepted it to be there..

boynet started a new conversation Forge How To Change The Default Nginx Configuration?

I need to use some costume options like allowing ip surfing(the default in only domain allowed) and a few more changes

1)I just need to ssh into server and change the config?

  1. if 1 is correct how I save changes across multiple servers? I need 10 same server
25 Oct
2 years ago

boynet left a reply on Laravel Visitor Counter ?

@maraboomint didn't mean to sound like that.. it's more like questioned argument - if you making a website for a client do you send him to look at google analytics?

boynet left a reply on Laravel Visitor Counter ?

@martinbean I think most sites have a hit counter.. google analytics is more for wide analytics I guess...

like a admin without technical knowledge want to know how many views a article has? should I send him to google analytics and explain to him how to search for a page? and that its not real time and the default don't show the date for today?

20 Oct
2 years ago

boynet left a reply on Detect If Multiselect Field Has Error?

I using this hack untill find the solution: check if input has error:

if (preg_grep("/^$name\\..*/", $errors->keys()))

get the input error:

$errors->first(collect(preg_grep("/^$name\\..*/", $errors->keys()))->first())

boynet left a reply on Detect If Multiselect Field Has Error?

if I am directly put $errors->first('categories.0') its working but the asterix ($errors->first('categories.*')) not

boynet left a reply on Detect If Multiselect Field Has Error?

@tomi I am trying to debug right now its weird

object(Illuminate\Support\ViewErrorBag)#398 (1) { ["bags":protected]=> array(1) { ["default"]=> object(Illuminate\Support\MessageBag)#400 (2) { ["messages":protected]=> array(1) { ["categories.0"]=> array(1) { [0]=> string(45) "error message" } } ["format":protected]=> string(8) ":message" } } } array(0) { }

I can see the categories.0 in the messages

boynet left a reply on Detect If Multiselect Field Has Error?

thanks both not working maybe I am missing something

boynet started a new conversation Detect If Multiselect Field Has Error?

for example multi select field named categories that has this validation:

'categories.*'=>'exists:businesses_categories,id|integer'

now if I do in my view

if ($errors->has('categories'))

its not working because the error name is looking like categories.2 or like categories.6

13 Oct
2 years ago

boynet left a reply on Signed In -> Page 1, NOT Signed In -> Page2

@NaelSaeed but I answerd this question

you point you route to a controller named index

you index method then check if is logged in called another method if he is not logged in call another method(in the same controller)

this is 100% working example:

public function index() {
    if (Auth::check()) {
      return  $this->loggedInPage();
    }
    else return $this->guestPage();
}

public function loggedInPage(){
    return "you are logged in";
}

public function guestPage(){
    return "you are guest";
}

boynet left a reply on Signed In -> Page 1, NOT Signed In -> Page2

@NaelSaeed I tell you why I dont just give you an answer because its look like you dont know about controllers and models so I I just tell you to "point you route to a controller method" then you will ask "what is a controller" and in the end I will just rewrite the whole docs

boynet left a reply on Signed In -> Page 1, NOT Signed In -> Page2

sorry I only want to help you :) the best way to start with laravel is from the docs, just read the sections to know all the needed stuff.

boynet left a reply on Signed In -> Page 1, NOT Signed In -> Page2

never go that way allways call controller from view like:

Route::get('/', ['as' => 'index, 'uses' => '[email protected]' ]);

boynet left a reply on How To Use Repository In A Class

you should read about interface here http://php.net/manual/en/language.oop5.interfaces.php without any laravel involve to understand how "native php" work.

boynet left a reply on How To Use Repository In A Class

@giwrgos php do this for you..

inside class B you need to do $classA = new classsA;

now you can use $classA

boynet left a reply on How To Use Repository In A Class

same thing like you use it in controller(which is simple php class) you use it in any other class(which they also just simple class) no magic involve :)

boynet left a reply on Signed In -> Page 1, NOT Signed In -> Page2

@NaelSaeed I gave you the answer..

Route::get('/', function(){
    if (Auth::check()) {
      return  $this->loggedInPage();
    }
    else return $this->guestPage();
});

public function loggedInPage(){
    return "you are logged in";
}

public function guestPage(){
    return "you are guest";
}

boynet left a reply on Signed In -> Page 1, NOT Signed In -> Page2

I will ask you this question that will lead you to the answer(from the docs)

  1. how to check if user is auth?
  2. how to return view? 3.how to create if statement? 4.how to return view1 if logged in and else how to return view2

boynet left a reply on Redis - How You Deal With Data Lose?

@ohffs If I understood correctly when master fails and data lost after restart it will load the last start and slave will replicate the new master without the lost data

boynet started a new conversation Redis - How You Deal With Data Lose?

lets say you have some ordered set of articles. each article entered the set on time of creation.

now for some reason the server crashed before redis persist the data and a new article was added and lost on redis. so now the article never appear on the articles lists how will you handle it?

or same scenario like a counter of unread mails, and server crashes before persist of last change and the counter now is wrong. so like user read all mails but the counter still show 1 unread mail.

how do you handle such scenario with redis? because of this reason I never used redis to more than caching.

I know about the option of always persist but then I lose the speed of redis

fsync every time a new command is appended to the AOF. Very very slow, very safe.

29 Aug
2 years ago

boynet left a reply on Couchbase Cache Driver

@TravisBlasingame Hi year later :) dosent couchbase is 100% replacement for memcached? so it just should work with the memcached driver?

28 Aug
2 years ago

boynet left a reply on Image Assets

you can put what ever you want in the public folder then if you do it will look for image in "public/imgs/image.jpg"

boynet left a reply on Image Assets

you can look at assest() or secure_assest() helpers: https://laravel.com/docs/5.3/helpers#method-asset

27 Aug
2 years ago

boynet started a new conversation Any Idea About Db Connection Without Caring For Errors?

I want to set up a secondary db server and send to it some unimportant logs data and without caring about itx existing at all? like if the server is down I don't want laravel to throw errors, or I dont even want to wait for insertiong just send the data and forget, is there any way about it? do you know some recommended db that maybe accept data with udp?

25 Aug
2 years ago

boynet left a reply on Any HMVC Plugin For Laravel 5.3?

@amitshrestha221 just found this libary like you but you see

This package is a re-published, re-organised and maintained version of pingpong/modules, which isn't maintained anymore. This package is used in AsgardCMS.

so I don't know if its 100% api similar to the pingpong but the same base

boynet left a reply on Caching Eloquent Models Since Laravel 5

caching models is not different than caching anything else :) same syntax in the docs

14 Aug
2 years ago

boynet left a reply on The Best Way ?

@SaeedPrez But this logic cant be apply to the rest of laravel :) if you have function that its just wrapper to php native function for my opinion it's always better to use the php function.

boynet left a reply on City And City Of Birth In The Users Table ?

you can simply do like users->id,name,city,cityOfBird and create onetomany relationshop

boynet left a reply on The Best Way ?

I say always use the native way(mb_strtolower) as it more future safe, laravel can take this library out of the framework and you will need to search and replace your whole code

07 Aug
2 years ago

boynet started a new conversation ManyToMany Attach To Touch Updated_at Model?

is it possible to make many to many changes to touch the model its related to? so if I have many to many relationship between posts and categories when i do: $post->attach(1) I want the post model upadated_at to updated, is it possible?

or I will ask it differently I want to be noted when many to many pivot table change

01 Aug
2 years ago

boynet left a reply on What Makes Jeffery Way Show His Face In Videos Lately?

so disappointed when his face disappear the entire video :)

boynet left a reply on Need Some Naming Advice

yes thanks :) really not sure if it's worth it any suggestions about the names? right now i have business_category(pivot) and businesses_categories(the categories name) but I get so confused working with it that I never remember what is what

boynet started a new conversation Need Some Naming Advice

I have multiple component that need category (posts,businesses etc..)

how will you name the DB tables and models? as there is posts categories and business categories, and there is also many to many pivot tables which get conflicted with the categories tables name and models

20 Jun
2 years ago

boynet left a reply on Just Moved My Site From One Domain To Another And Getting File Permissions Error

the error you get is "failed to open stream: Permission denied" pretty sure its that the error is related to the blade view cache files. make sure that the 777 is recursive to all the files inside the storage folder

boynet left a reply on Complaining About Parallelism

yap noticed it too, look like it's always stopping when it getting more complicated. but we always getting this js lessons when we registered for php lessons