boynet

Experience

12,095

2 Best Reply Awards

  • Member Since 2 Years Ago
  • 124 Lessons Completed
  • 2 Favorites

25th July, 2017

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

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

24th July, 2017

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

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?

12th July, 2017

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

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';
    ]
 }
}

2nd July, 2017

boynet started a new conversation Eloquent How To Binding Variable Into Inet_aton • 3 months ago

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]);

19th March, 2017

boynet left a reply on Docs Not Clear About Phpredis Usage? • 7 months ago

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? • 7 months ago

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? • 7 months ago

@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? • 7 months ago

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? • 7 months ago

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?

23rd February, 2017

boynet started a new conversation Forge How To Disable Nginx Default Redirection? • 7 months ago

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? • 7 months ago

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

boynet started a new conversation Forge How To Change The Default Nginx Configuration? • 7 months ago

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

25th October, 2016

boynet left a reply on Laravel Visitor Counter ? • 11 months ago

@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 ? • 11 months ago

@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?

20th October, 2016

boynet left a reply on Detect If Multiselect Field Has Error? • 1 year ago

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? • 1 year ago

@tomi nope..

boynet left a reply on Detect If Multiselect Field Has Error? • 1 year ago

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? • 1 year ago

@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? • 1 year ago

thanks both not working maybe I am missing something

boynet started a new conversation Detect If Multiselect Field Has Error? • 1 year ago

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

13th October, 2016

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

@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 • 1 year ago

@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 • 1 year ago

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 • 1 year ago

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 • 1 year ago

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 • 1 year ago

@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 • 1 year ago

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 • 1 year ago

@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 • 1 year ago

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? • 1 year ago

@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? • 1 year ago

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.

29th August, 2016

boynet left a reply on Couchbase Cache Driver • 1 year ago

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

28th August, 2016

boynet left a reply on Image Assets • 1 year ago

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 • 1 year ago

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

27th August, 2016

boynet started a new conversation Any Idea About Db Connection Without Caring For Errors? • 1 year ago

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?

25th August, 2016

boynet left a reply on Any HMVC Plugin For Laravel 5.3? • 1 year ago

@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 • 1 year ago

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

14th August, 2016

boynet left a reply on The Best Way ? • 1 year ago

@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 ? • 1 year ago

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

boynet left a reply on The Best Way ? • 1 year ago

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

7th August, 2016

boynet started a new conversation ManyToMany Attach To Touch Updated_at Model? • 1 year ago

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

1st August, 2016

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

so disappointed when his face disappear the entire video :)

boynet left a reply on Does Laravel 5.2 Automatically Sanitizes The Input • 1 year ago

yap always use purifier

boynet left a reply on Need Some Naming Advice • 1 year ago

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 • 1 year ago

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

20th June, 2016

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

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 • 1 year ago

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

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

look at https://laravel.com/docs/5.2/installation#configuration

Directory Permissions

After installing Laravel, you may need to configure some permissions. Directories within the storage and the bootstrap/cache directories >should be writable by your web server or Laravel will not run. If you are using the Homestead virtual machine, these permissions should >already be set.

Edit Your Profile
Update

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