Lets say in a directory have million of files, and i want to retrieve only one file, how much time will it takes?

|
acrossoffwest 2019-07-27 19:07:36
2019-07-27 18:34:52
Hey guys,
I created an api route, it’s working on local machine, when deployed to server, it’s giving 404 error.

If you are using php-fpm try to restart it

ucouldbemine 2019-07-27 19:09:12
2019-07-27 18:34:52
Hey guys,
I created an api route, it’s working on local machine, when deployed to server, it’s giving 404 error.

Check .htaccess

2019-07-27 19:14:52
okay, trying and will let you know if worked
athfan 2019-07-27 22:05:28
anyone got Select2 Ajax data loading working? Links to some videos and code would help. thanks
joseph_ayuk 2019-07-27 23:57:21
2019-07-27 18:34:52
Hey guys,
I created an api route, it’s working on local machine, when deployed to server, it’s giving 404 error.

How do you access the route ? Do you use a URL helper ?

2019-07-28 00:08:03
joseph_ayuk 2019-07-27 23:57:21
How do you access the route ? Do you use a URL helper ?

Just making a curl request to that url

2019-07-28 00:08:14
No not using the url helper
Mael54 2019-07-28 01:32:04
Hello guys. I’m working on a laravel 5.8 project and I want to make the url rewriting on production web server but it don’t work. I want to remove the public in the my application url. Someone to help me ?
zack6849 2019-07-28 02:03:59
mhd_arffnn 2019-07-27 17:40:06
lets say in a directory have million of files, and i want to retrieve only one file, how much time will it takes?

Depends on the underlying filesystem

zack6849 2019-07-28 02:05:57
Mael54 2019-07-28 01:32:04
Hello guys. I’m working on a laravel 5.8 project and I want to make the url rewriting on production web server but it don’t work. I want to remove the public in the my application url. Someone to help me ?

Your webroot should be set to public

zack6849 2019-07-28 02:06:18
You shouldn’t need to rewrite anything for that, just change the config for your Webservers host
daemon_coder 2019-07-28 02:10:31
Mael54 2019-07-28 01:32:04
Hello guys. I’m working on a laravel 5.8 project and I want to make the url rewriting on production web server but it don’t work. I want to remove the public in the my application url. Someone to help me ?

if its on a shared hosting, just copy the contents of the public folder to public_html folder and edit it to point to the appropiate location of the files its requiring.

Mael54 2019-07-28 02:10:49
zack6849 2019-07-28 02:06:18
You shouldn’t need to rewrite anything for that, just change the config for your Webservers host

OK thank you for your help. I do not really understand, but I will try to see that with the host

StanleyMasinde 2019-07-28 07:23:00
Patricklab 2019-07-26 13:28:20
This is error am getting when trying to connect with the server api which is running on laravel

You need an API token appended in your request. Or you can use API routes without the auth middleware

Patricklab 2019-07-28 07:24:31
StanleyMasinde 2019-07-28 07:23:00
You need an API token appended in your request. Or you can use API routes without the auth middleware

How kindly help me out let me inbox you

StanleyMasinde 2019-07-28 07:25:26
Patricklab 2019-07-28 07:24:31
How kindly help me out let me inbox you

After 1030am East african time please

MatPk 2019-07-28 08:29:02
The use statement with non-compound name ‘ProfileTableSeeder’ has no effect

i use
php artisan db:seed and get this error
what is the problem

2019-07-28 09:02:55
Kuna project nimeeka heroku, shida, haimigrate tables iko na foreign keys
GauravGohil 2019-07-28 09:32:52
$(‘.selected-table [data-text]’).each(function(){
texteditor = new Jodit(this, {
inline: true,
toolbar: false,
toolbarInline: true,
spellcheck:false,
popup: {
selection: [
‘bold’,
‘underline’,
‘italic’,
‘strikethrough’,
‘ul’,
‘ol’,
‘link’,
],
a: Jodit.Array([‘unlink’, ‘eye’,’brush’])
},
link:{
noFollowCheckbox: false,
openInNewTabCheckbox: false,
followOnDblClick: false
},
showXPathInStatusbar: false,
showCharsCounter: false,
showWordsCounter: false,
showPlaceholder: false
});
});
GauravGohil 2019-07-28 09:33:21
the above code is my code for initalising jodit on all data-text element
GauravGohil 2019-07-28 09:33:41
now i want to destuct all which i have initialised
GauravGohil 2019-07-28 09:34:12
on desctruct it only destructs the last one not all
GauravGohil 2019-07-28 09:34:23
how can i destruct all
2019-07-28 10:00:21
Hi, is there any one working on laravel open source project ?
2019-07-28 10:00:42
I’m interested to work with laravel open source project
Patricklab 2019-07-28 10:02:36
2019-07-28 10:00:42
I’m interested to work with laravel open source project

Yes inbox

2019-07-28 10:04:15
Patricklab 2019-07-28 10:02:36
Yes inbox

Ok

ransikoo 2019-07-28 14:34:17
i need a create filter in myshop but i dnot know about filter>please link tutorial for create this in myshop
2019-07-28 14:43:34
ransikoo 2019-07-28 14:34:17
i need a create filter in myshop but i dnot know about filter>please link tutorial for create this in myshop

That one I can help let me check,

ransikoo 2019-07-28 14:47:24
2019-07-28 14:43:34
That one I can help let me check,

๐Ÿ™help

2019-07-28 14:55:52
ransikoo 2019-07-28 14:47:24
๐Ÿ™help

The tutorial I can’t locate it but let me show u here full, I hope u won’t mind spare some time,

2019-07-28 14:56:04
By the can be copy pasting
2019-07-28 14:59:21
EdcbaoO 2019-07-09 11:09:32
Hi guys… Anyone beginner here wants to practice Laravel with us.. As we will start applying online courses in specific time then create our own projects later.. The idea is just to get motivated together and help each other in the process

Yes I m interested…very much

2019-07-28 15:04:13
2019-07-28 14:55:52
The tutorial I can’t locate it but let me show u here full, I hope u won’t mind spare some time,

laravel_discuss-10047.jpg

2019-07-28 15:04:13
step by step, let me hope your database is linked to other tables via foreign keys, and some values like age, are in the same tables, like this snapshot
2019-07-28 15:06:15
create a folder under App, in laravel application call it Filter, it will hold all the filter functions that will be collected from controller
2019-07-28 15:06:15
2019-07-28 14:55:52
The tutorial I can’t locate it but let me show u here full, I hope u won’t mind spare some time,

laravel_discuss-10048.jpg

2019-07-28 15:10:08
2019-07-28 15:06:15
create a folder under App, in laravel application call it Filter, it will hold all the filter functions that will be collected from controller

laravel_discuss-10050.jpg

2019-07-28 15:10:09
in that folder (Filters) create a main file know as AbstractFilter.php as
2019-07-28 15:11:00
2019-07-28 15:10:09
in that folder (Filters) create a main file know as AbstractFilter.php as

in that abstractfile add <?php

// AbstractFilter.php

namespace AppFilters;

use IlluminateHttpRequest;
use IlluminateDatabaseEloquentBuilder;

abstract class AbstractFilter
{
protected $request;

protected $filters = [];

public function __construct(Request $request)
{
$this->request = $request;
}
public function filter(Builder $builder)
{
foreach($this->getFilters() as $filter => $value)
{
$this->resolveFilter($filter)->filter($builder, $value);
}
return $builder;
}
protected function getFilters()
{
return array_filter($this->request->only(array_keys($this->filters)));
}

protected function resolveFilter($filter)
{
return new $this->filters[$filter];
}
}

2019-07-28 15:13:53
2019-07-28 15:11:00
in that abstractfile add <?php

// AbstractFilter.php

namespace AppFilters;

use IlluminateHttpRequest;
use IlluminateDatabaseEloquentBuilder;

abstract class AbstractFilter
{
protected $request;

protected $filters = [];

public function __construct(Request $request)
{
$this->request = $request;
}
public function filter(Builder $builder)
{
foreach($this->getFilters() as $filter => $value)
{
$this->resolveFilter($filter)->filter($builder, $value);
}
return $builder;
}
protected function getFilters()
{
return array_filter($this->request->only(array_keys($this->filters)));
}

protected function resolveFilter($filter)
{
return new $this->filters[$filter];
}
}

then create filter fucntion, for instance if you want to filter lets say, in my case am filtering house helps in gender, male or female, and in my query i will pass gender id either 1 or2, so now create GenderFilter insame folder as AbstractFilter as showninpreviousmage inthat file add following code and remember to import

2019-07-28 15:14:20
2019-07-28 15:13:53
then create filter fucntion, for instance if you want to filter lets say, in my case am filtering house helps in gender, male or female, and in my query i will pass gender id either 1 or2, so now create GenderFilter insame folder as AbstractFilter as showninpreviousmage inthat file add following code and remember to import

laravel_discuss-10054.jpg

2019-07-28 15:14:40
the code,
// GenderFilter.php

namespace AppFilters;

class GenderFilter
{
public function filter($builder, $value)
{
return $builder->where(‘gender_id’, ‘=’, $value);
}
}

2019-07-28 15:15:46
2019-07-28 15:14:40
the code,
// GenderFilter.php

namespace AppFilters;

class GenderFilter
{
public function filter($builder, $value)
{
return $builder->where(‘gender_id’, ‘=’, $value);
}
}

you can duplicate all the code for all the iltervraibles u want,but change theforeign key to match your query key, if its gener be gender_idas used in database, like this

2019-07-28 15:16:12
2019-07-28 15:15:46
you can duplicate all the code for all the iltervraibles u want,but change theforeign key to match your query key, if its gener be gender_idas used in database, like this

laravel_discuss-10057.jpg

2019-07-28 15:19:11
after all the filter functions u want to use to filter have been established u can go back now to the main model you are filtering, in my case househelp (in your case is products) model, and add a scope function as this code: // filter
public function scopeFilter(Builder $builder, $request)
{
return (new HousehelpFilter($request))->filter($builder);
} remember to import the required classes
2019-07-28 15:19:48
now letsgo to the controller esponsible for filtering in my case househelpController,
2019-07-28 15:21:13
2019-07-28 15:19:48
now letsgo to the controller esponsible for filtering in my case househelpController,

laravel_discuss-10060.jpg

2019-07-28 15:21:27
the code: // detailed filtration
public function filter(Request $request)
{
$househelps = Househelp::
with(‘country’, ‘county’, ‘constituency’, ‘ward’,’gender’, ‘education’, ‘experience’, ‘tribe’, ‘skill’,’duration’,
‘operation’, ‘englishstatus’,’maritalstatus’, ‘religion’, ‘kid’)
->filter($request) ->paginate(24);
return response()-> json([
‘househelps’ => $househelps,
], 200);
}
2019-07-28 15:23:14
now with that am through, everything will work as you send your request from the frontend, in terms of a form, in mycase i use vuejs, combined with laravel, but you canuse as well ajax to make quesrieseven astyping or choosing different filters, chek my code n vuejs
|